Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > string to unicode

Reply
Thread Tools

string to unicode

 
 
Artie Ziff
Guest
Posts: n/a
 
      08-15-2011
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!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help for Unicode char and Unicode char based string in Ruby Chirag Mistry Ruby 6 02-08-2008 12:45 PM
[unicode] inconvenient unicode conversion of non-string arguments Holger Joukl Python 5 12-13-2006 10:10 PM
Unicode digit to unicode string Gabriele *darkbard* Farina Python 2 05-16-2006 01:15 PM
how to convert string like '\u5927' to unicode string u'\u5927' Chris Song Python 3 12-27-2005 11:40 AM
how to convert string like '\u5927' to unicode string u'\u5927' Chris Song Python 1 12-27-2005 11:06 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57