I am using python code to encode text before inserting into a database in a remote server (linux). Since I have special characters so I need to encode them to unicode. But I got following error while encoding text.
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf8 in position 2: ordinal not in range(128)
my code is:
for item in dict.iteritems():
name = item[0].encode('UTF-8') -- error in this line
..........
What does this mean? Why this works in WIndows7 and not in Linux ? I am very new to linux, so did not understand the way it worked differently in windows7 and linux.