Hi Mike.
Strange enough but i solved it due to one major hint you gave me knowingly or unknowingly.
I did convert my data to string.
It was unicode string i suppose.
And yes I had to use cdata also.
Now it works fine.
By the way you were right json does it pritty well it was not json's problem.
Thanks a lot.
Happy hacking.
Krishnakant.

On 28/07/11 23:30, Mike Orr wrote:
By the way, if you can't extract the data any other way, you can do two things:

- Create a temporary model with binary columns, which will fetch the
strings without modifying them.
- Decode the values in Python to unicode using latin1, or with one of
the 'errrors' arguments to the decode method.

Python's implementation of latin1 assigns unicode characters to all
256 byte values, even though 0x90-0x9f are undefined in latin1. They
show up as zero-space unprintable characters. That's the normal way in
Python to deal with strings in unknown character sets. It distorts
some of the characters, but that may be better than not seeing the
values at all.

'A\x80B'.decode('latin1')
u'A\x80B'
print 'A\x80B'.decode('latin1')
AB
s = 'A\x80B'.decode('latin1')
len(s)
3
list(s)
[u'A', u'\x80', u'B']


--
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en.

Reply via email to