views:

23

answers:

2

I am using JSON_ENCODE in PHP to output data. When it gets to this word: Æther it outputs \u00c6ther.

Anyone know of a way to make json output that character or am I going to have to change the text to not have that character in it?

+4  A: 

That's the unicode version of the character. JavaScript should handle it properly. You'll notice the slash before it which means that it's an escape sequence. The u indicates it's a unicode code point and the hex digits represent the actual character.
See here for some more info.

Drackir
+2  A: 

That is working as specified. The RFC ( http://www.ietf.org/rfc/rfc4627.txt ) indicates that any character may be escaped, and your average printable character can be written in the \uXXXX format.

Any JSON parser that cannot understand a character escaped in that way is not compliant with the standard. Work on resolving that problem rather than trying to coax PHP into misbehaving as well.

(It is legal to put UTF-8 characters into JSON strings without escaping them as well, with a few exceptions, but the safe approach of escaping anything questionable is wise.)

VoteyDisciple