Remove uncide notation

A

Ashish Jain

Hi,

I have a html string in an object, when I do repr() of that object, I get value as:

{'Id' : 1, 'Body': u'<p> Hello </p>'}

I don't wish to have 'u' as the character in my string representation. As this is not a valid json notation now.

Thanks for your help

-Ashish
 
C

Chris Rebert

Hi,

I have a html string in an object, when I do repr() of that object, I get value as:

{'Id' : 1, 'Body': u'<p> Hello </p>'}

I don't wish to have 'u' as the character in my string representation. As this is not a valid json notation now.

If you want JSON, then *use the freakin' `json` std lib module*!
http://docs.python.org/library/json.html

repr(...) != JSON
[It's similar only coincidentally, and only to a degree.]

Regards,
Chris
 
A

Ashish Jain

Hi,

I have a html string in an object, when I do repr() of that object, I get value as:

{'Id' : 1, 'Body': u'<p> Hello </p>'}

I don't wish to have 'u' as the character in my string representation. As this is not a valid json notation now.



If you want JSON, then *use the freakin' `json` std lib module*!

http://docs.python.org/library/json.html



repr(...) != JSON

[It's similar only coincidentally, and only to a degree.]



Regards,

Chris

Thanks a lot!!
 
A

Ashish Jain

Hi,

I have a html string in an object, when I do repr() of that object, I get value as:

{'Id' : 1, 'Body': u'<p> Hello </p>'}

I don't wish to have 'u' as the character in my string representation. As this is not a valid json notation now.



If you want JSON, then *use the freakin' `json` std lib module*!

http://docs.python.org/library/json.html



repr(...) != JSON

[It's similar only coincidentally, and only to a degree.]



Regards,

Chris

Thanks a lot!!
 
8

88888 Dihedral

Ashish Jainæ–¼ 2012å¹´10月18日星期四UTC+8下åˆ5時27分04秒寫é“:
Hi,



I have a html string in an object, when I do repr() of that object, I getvalue as:



{'Id' : 1, 'Body': u'<p> Hello </p>'}



I don't wish to have 'u' as the character in my string representation. Asthis is not a valid json notation now.



Thanks for your help



-Ashish

I remembered about 15 years ago that the MS office and IE were
supporting different languages all over the world to collect money$$$!

Of course there were ISO standards. But in business Wintel did
several very good jobs before year 2000 for those different encodings of
languages.

Now the unicode is the default standard in software development
for multi-lingual supports of web sites all over the world.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top