Monday, April 02, 2007

How to return a character with an accent in JSON?

While ~ by itself renders correctly, the letter with tilde will not.
You should treat it as a special character.




For example:

{"wclass":[{"student":{"id":"1"},"name": "ñinda Jones",

"legacySkill":"Access, VB 5.0"},{"student":{"id":"2"},"name":"Adam Davidson",

"legacySkill":"Cobol, MainFrame"},{"student":{"id":"3"},"name":"Charles Boyer",

"legacySkill":"HTML, XML"}]}

will render correctly as in(IE as well as FireFox browsers):

This is json text

{"wclass":[{"student":{"id":"1"},"name":"ñinda Jones", "legacySkill":"Access, VB 5.0"},{"student":{"id":"2"},"name":"Adam Davidson", "legacySkill":"Cobol, MainFrame"},{"student":{"id":"3"},"name":"Charles Boyer", "legacySkill":"HTML, XML"}]}

No comments:

DMCA.com Protection Status