Top "Python-unicode" questions

Python distinguishes between byte strings and unicode strings.

how to convert Python 2 unicode() function into correct Python 3.x syntax

I enabled the compatibility check in my Python IDE and now I realize that the inherited Python 2.7 code has a …

python python-3.x python-unicode
python byte string encode and decode

I am trying to convert an incoming byte string that contains non-ascii characters into a valid utf-8 string such that …

python json unicode utf-8 python-unicode
Python3: UnicodeEncodeError: 'ascii' codec can't encode character '\xfc'

I'am trying to get running a very simple example on OSX with python 3.5.1 but I'm really stucked. Have read so …

python-3.x iso-8859-1 python-unicode
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 6: ordinal not in range(128)

I am trying to pull a list of 500 restaurants in Amsterdam from TripAdvisor; however after the 308th restaurant I get …

python python-2.7 web-scraping python-unicode
decoding and encoding Hebrew string in Python

I am trying to encode and decode the Hebrew string "שלום". However, after encoding, I get gibberish: >>> word = "שלום" &…

python python-unicode
python 2.7 lowercase

When I use .lower() in Python 2.7, string is not converted to lowercase for letters ŠČŽ. I read data from dictionary. I …

python python-2.7 unicode lowercase python-unicode
Open() and codecs.open() in Python 2.7 behave strangely different

I have a text file with first line of unicode characters and all other lines in ASCII. I try to …

python python-2.7 file-io codec python-unicode
base64 encoding unicode strings in python 2.7

I have a unicode string retrieved from a webservice using the requests module, which contains the bytes of a binary …

python character-encoding base64 unicode-string python-unicode
TypeError: write() argument 1 must be unicode, not str

I'm trying import a text file and save it on my desktop, but the text is in "utf-8" (there is …

python python-2.7 urllib2 python-unicode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 3: invalid continuation byte

I'm trying to load a csv file using pd.read_csv but I get the following unicode error: UnicodeDecodeError: 'utf-8…

pandas csv unicode load python-unicode