Remove uncide notation

Discussion in 'Python' started by Ashish Jain, Oct 18, 2012.

  1. Ashish Jain

    Ashish Jain Guest

    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
    Ashish Jain, Oct 18, 2012
    #1
    1. Advertising

  2. Ashish Jain

    Chris Rebert Guest

    On Thu, Oct 18, 2012 at 2:27 AM, Ashish Jain <> wrote:
    > 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
    Chris Rebert, Oct 18, 2012
    #2
    1. Advertising

  3. Ashish Jain

    Ashish Jain Guest

    On Thursday, 18 October 2012 15:10:33 UTC+5:30, Chris Rebert wrote:
    > On Thu, Oct 18, 2012 at 2:27 AM, Ashish Jain wrote:
    >
    > > 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!!
    Ashish Jain, Oct 18, 2012
    #3
  4. Ashish Jain

    Ashish Jain Guest

    On Thursday, 18 October 2012 15:10:33 UTC+5:30, Chris Rebert wrote:
    > On Thu, Oct 18, 2012 at 2:27 AM, Ashish Jain wrote:
    >
    > > 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!!
    Ashish Jain, Oct 18, 2012
    #4
  5. 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.
    88888 Dihedral, Oct 19, 2012
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,372
    Henrik
    Aug 10, 2005
  2. tshad
    Replies:
    6
    Views:
    21,461
    tshad
    Aug 8, 2006
  3. Grey Squirrel

    Hungarian Notation Vs. Pascal Notation?

    Grey Squirrel, Mar 19, 2007, in forum: ASP .Net
    Replies:
    6
    Views:
    1,300
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Mar 21, 2007
  4. Tameem
    Replies:
    454
    Views:
    11,863
  5. Robert Mark Bram

    Dot notation V Bracket notation

    Robert Mark Bram, Jul 4, 2003, in forum: Javascript
    Replies:
    3
    Views:
    467
    Robert Mark Bram
    Jul 5, 2003
Loading...

Share This Page