views:

29

answers:

0

Hey there,

I have a Django database & backend and my WebService is returning \u codes in place of what should be UTF-8 characters.

For example, the bullet mark character is '•' returned as '\u00ae'.

My front end (an iPhone App) doesn't understand this as a bullet mark (•), and prints the UTF-8 code. I understand I need to somehow decode this UTF-8 character, but I'm not sure what the '\u00ae' actually means.

Should I look to get my webservices to return the correct UTF-8 formatting, or my front end to display the UTF-8 code correctly?

Thanks for any help & pointers.


I found my answer here:

http://docs.djangoproject.com/en/dev/topics/serialization/#notes-for-specific-serialization-formats

*If you're using UTF-8 (or any other non-ASCII encoding) data with the JSON serializer, you must pass ensure_ascii=False as a parameter to the serialize() call. Otherwise, the output won't be encoded correctly.*