On Wed, Jan 18, 2012 at 5:27 AM, Gustaf Nilsson <[email protected]> wrote: > Hi > > (probably) NOT pyjamas fault, but i need advice on what level to attack this > problem. > > I just noticed yesterday that if i use swedish characters in my webapp, the > following things happen: > > *app creates save data properly(?) in json format (i can see the swedish > characters in there)
yep. > *app wont read the above json project data correctly (doesnt decode it > properly?) marginally confused here. you're sending the data as utf-8? [that's all you can do]. can you get a dump (tcpdump or wireshark or some other method) of what you're doing? > *cherrypy backend gives me ascii codec errors when trying to write it to > file yeah that sounds about right. worst case use repr but that's.... yuck. > So, after reading up on unicode/utf-8 i ask at what level do I treat this? > > Are textboxes unicode? in browsers? nope > does the TextArea.getText() return unicode? nnnnnope > should i encode to utf-8 everytime i read a textarea or should I only do > that at the time of creating my (json) save data? yyyyyep :) > does the json encoder/decoder in pyjamas support unicode? no because browsers don't comprehend unicode. unfortunately pyjd _does_ comprehend unicode so you have to watch out for that. > I realise im probably not presenting this problem clearly, let me know if > something needs explaining! you're in browser-land. browsers have no concept of unicode, however, that hasn't stopped us from trying to support it... as utf-8. l.

