CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Problem entering unicode value in contact fields (API v3)
Pages: [1]

Author Topic: Problem entering unicode value in contact fields (API v3)  (Read 854 times)

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Problem entering unicode value in contact fields (API v3)
August 06, 2011, 08:29:05 am
Hi guys,

Thanks to lobo and X+, I finally managed to communicate with Civi via Api v3! (Thanks a lot guys!)

Now I have a new challenge - when updating a custom filed value with Ascii value, hte update is accomplished OK.

However, when i do the same with Hebrew chars, the field remains blank.
I tried to use encodeurl($value) - got some encoded version of "יש" in the field, which encourages me to believe that the unicode characters are not supported(?) - any experience with unicode chars with Api v3?

Thanks!
Yosi
« Last Edit: August 06, 2011, 08:32:54 am by yositsitsu »

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problem entering unicode value in contact fields (API v3)
August 06, 2011, 08:36:31 am
Is this only for custom field?

Otherwise, works in unicode by default it seems. try to get a contact with unicode first name, see how it works.

X+
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Re: Problem entering unicode value in contact fields (API v3)
August 07, 2011, 12:05:44 pm
Thanks for your quick reply Xavier and sorry for the delay - been a bit busy with business meetings and activities on the internet.

Anyway, I did what you suggested and got the same result.

The underline is the following:
1. Retrieve statements seem to work OK for Unicode values => get operations work like charm.
2. Update statements fail to perform the update properly and remove the target field value, leaving it blank.
3. The above is true for both custom and basic (built-in) fields - checked for first_name and a custom field.

Any suggestions?

xavier

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4453
  • Karma: 161
    • Tech To The People
  • CiviCRM version: yes probably
  • CMS version: drupal
Re: Problem entering unicode value in contact fields (API v3)
August 07, 2011, 01:08:39 pm
Hi,

Just tried (using ajax) and it worked!?

Can you try using the api explorer and edit a field?

Please post the relevant code extract, are you 100% sure it's utf8 encoded.
-Hackathon and data journalism about the European parliament 24-26 jan. Watch out the result

yositsitsu

  • I post occasionally
  • **
  • Posts: 30
  • Karma: 2
  • CiviCRM version: 4.0.4
  • CMS version: joomla 1.6.3
  • MySQL version: 5.5.8-log
  • PHP version: 5.3.5
Re: Problem entering unicode value in contact fields (API v3)
August 07, 2011, 01:47:56 pm
Oh my God... Much ado about nothing - so sorry and glad that it was just a noob time-waster!

The php script was not actually saved in UTF-8 encoding - sorry for that man.

I fixed that and now I'm glad it works exactly as you claim Xavier!

Thanks a lot mate!
Yosi

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Problem entering unicode value in contact fields (API v3)

This forum was archived on 2017-11-26.