Json encode for right to left languages
Hi,
I'm extracting text from a database, which can be in any language.
I need to use JSON to pass the text from PHP to Open flash chart package.
My problem is when the text is in right to left language (Like Hebrew/Arabic) the encoded text is in the opposite order (For example the text "Hello word" is encoded as "word Hello").
What can I do to prevent this from happening?
Thanks
benf posted this at 22:53 — 23rd April 2010.
They have: 426 posts
Joined: Feb 2005
you must have the text encoded incorrectly. Are you pulling Hebrew from the database or English? Encode in the correct character set.
levona posted this at 10:07 — 25th April 2010.
They have: 3 posts
Joined: Apr 2010
The text I'm pulling from the DB can be English or Hebrew.
To support both we use UTF-8 encoding.
Is there an extra encoding I must do when I'm extracting the text?
levona posted this at 12:57 — 25th April 2010.
They have: 3 posts
Joined: Apr 2010
I just wanted to say again, that the words are encoded (and decoded) to JSON correctly, but the order of the words is wrong.
The string I pass to the JSON is UTF-8 encoded.
Thanks
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.