Re: pear ajax and accented letters

From: Date: Tue, 17 Jan 2006 19:52:51 +0000
Subject: Re: pear ajax and accented letters
References: 1 2 3 4 5 6 7  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-22564@lists.php.net to get a copy of this message
It looks to me like its not escaping some of the unicode characters properly. The unicode escape sequence is \u followed by 4 characters so im not sure what the second set of 4 does. For a test i added in the second \u and things seem to be ok: http://bluga.net/projects/HTML_AJAX/test.php There must be some bug in unicode escaping, I put in an untested fix that should fix the problem as long as you have mbstring installed. Just grab http://svn.bluga.net/HTML_AJAX/trunk/AJAX/JSON.php again. -josh Adi wrote:
The code runs now, however, json is still having trouble unserializing my data. I am sending back a multidimentional array that has the following structure: arra('word' => 'aple',
       'suggestions' => array('Apple', 'apple', 'pale', 'ample', 'ale',
'ape', 'maple')); This is what the server is returning...: raw: [{"word":"caract\u00e8res","suggestions":["caract\u00720065s","caract\u00720065"]}] unserialized: the two word suggestions print like this: - caractr0065s - caractr0065 Please advise... Thanks... On 1/17/06, Joshua Eichorn <josh@bluga.net> wrote:
Adi wrote:
    
I reconfigured my php with multibyte support and I can post data to the
server with no problem, however, now the php JSON server side code is producing further problems...its just a notice, but the data returned is useless: PHP Notice: Uninitialized string offset: 7 in /data/www2/newFramework/lib/pear/HTML/AJAX/JSON.php on line 120 Is there a way around this by any chance? Thanks for your time...
      
The JSON code is actually from Services_JSON which hasn't had a released yet, there is an updated version that might fix this problem. I'll update the version in HTML_AJAX before the next release but that could be a week or so. If you want to give the updated JSON code a try you can downloaded an updated version from: http://svn.bluga.net/HTML_AJAX/trunk/AJAX/JSON.php Just replace /data/www2/newFramework/lib/pear/HTML/AJAX/JSON.php with the updated file. If that doesn't fix it let me know and will get Michal involved. -josh
    
-- Take care... Adam


« previous php.pear.general (#22564) next »