Just out of curiosity, what do the browsers use then? because i can see all
sorts of foreign characters while surfin the internets

G

On Wed, Jan 18, 2012 at 12:09 AM, lkcl luke <[email protected]> wrote:

> 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.




-- 
■ ■ ■ ■ ■ ■ ■ ■ ■ ■

Reply via email to