On Thu, Mar 20, 2008 at 7:50 PM, Bob Ippolito <[EMAIL PROTECTED]> wrote:
> > Anyway, to get JSON in UTF-8, I'm calling it like this:
> >
> > simplejson.dumps( ["\x1a"], ensure_ascii=False ).encode('utf8')
> >
> > which on my system outputs this: '["\x1a"]'
> > rather than this: '["\\u001a"]'
> >
> > If I change the ensure_ascii to its default of True, then I do get
> > the correct results.
>
> Okay, so I was using the default settings, which is ensure_ascii=True,
> and I was getting correct results. I didn't know you were testing with
> ensure_ascii=False.
I almost missed that one myself too. That's why I finally decided to
get so detailed, to find little things like that. I also found a few bugs
in mine as well by doing this exercise (although I had the advantage
of fixing mine before anybody could see :)
I assume that will be a really easy fix for you. But, I am using it the
right way though, aren't I?
--
Deron Meranda
_______________________________________________
Web-SIG mailing list
[email protected]
Web SIG: http://www.python.org/sigs/web-sig
Unsubscribe:
http://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com