set python default encoding

Discussion in 'Python' started by reetesh nigam, Apr 6, 2009.

  1. Hi All,
    I am unable to set the python default encoding.
    i used the following proccess to set the python encoding

    import sys
    reload(sys)
    sys.setdefaultencoding('latin-1')

    but it is giving me the same error :

    args = ('utf8', "MEDICINE '\xc4 ", 10, 12, 'invalid data',
    <bound method Root.history of <radspeed.controllers.Root object at
    0x036FFE90>>)
    encoding = 'utf8'
    end = 12
    message = ''
    object = "MEDICINE '\xc4 "
    reason = 'invalid data'
    start = 10


    Please tell me how to solve this problem.

    Thanks and Regards

    Reetesh Nigam
    reetesh nigam, Apr 6, 2009
    #1
    1. Advertising

  2. reetesh nigam <> wrote:
    > Hi All,
    > I am unable to set the python default encoding.
    > i used the following proccess to set the python encoding
    >
    > import sys
    > reload(sys)
    > sys.setdefaultencoding('latin-1')
    >
    > but it is giving me the same error :
    >
    > args = ('utf8', "MEDICINE '\xc4 ", 10, 12, 'invalid data',
    > <bound method Root.history of <radspeed.controllers.Root object at
    > 0x036FFE90>>)
    > encoding = 'utf8'
    > end = 12
    > message = ''
    > object = "MEDICINE '\xc4 "
    > reason = 'invalid data'
    > start = 10
    >
    >
    > Please tell me how to solve this problem.


    That doesn't look anything like a python traceback. I'm guessing
    you are using some sort of web framework? Perhaps you should
    try asking in the forum for the framework.

    --
    R. David Murray http://www.bitdance.com
    R. David Murray, Apr 6, 2009
    #2
    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. Hardy Wang

    Encoding.Default and Encoding.UTF8

    Hardy Wang, Jun 8, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    18,832
    Jon Skeet [C# MVP]
    Jun 9, 2004
  2. Michel de Becdelièvre
    Replies:
    3
    Views:
    2,979
    Joerg Jooss
    Mar 6, 2006
  3. kj
    Replies:
    2
    Views:
    349
  4. cs_professional
    Replies:
    14
    Views:
    5,228
    cs_professional
    Dec 12, 2010
  5. SibAndela
    Replies:
    1
    Views:
    187
    Jeff Cochran
    Sep 26, 2004
Loading...

Share This Page