string to unicode

Discussion in 'Python' started by Artie Ziff, Aug 15, 2011.

  1. Artie Ziff

    Artie Ziff Guest

    if I am using the standard csv library to read contents of a csv file
    which contains Unicode strings (short example:
    '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such
    as decode or encode to transform this string type into a python unicode
    type? Must I know the encoding (byte groupings) of the Unicode? Can I
    get this from the file? Perhaps I need to open the file with particular
    attributes?

    thanks!
    Artie Ziff, Aug 15, 2011
    #1
    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. Robert Mark Bram
    Replies:
    0
    Views:
    3,917
    Robert Mark Bram
    Sep 28, 2003
  2. ygao

    unicode wrap unicode object?

    ygao, Apr 8, 2006, in forum: Python
    Replies:
    6
    Views:
    544
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=
    Apr 8, 2006
  3. Gabriele *darkbard* Farina

    Unicode digit to unicode string

    Gabriele *darkbard* Farina, May 16, 2006, in forum: Python
    Replies:
    2
    Views:
    515
    Gabriele *darkbard* Farina
    May 16, 2006
  4. Holger Joukl
    Replies:
    5
    Views:
    528
    Ben Finney
    Dec 13, 2006
  5. Chirag Mistry
    Replies:
    6
    Views:
    167
    Ollivier Robert
    Feb 8, 2008
Loading...

Share This Page