encoding latin1 to utf-8

Carsten Haese carsten at uniqsys.com
Mon Sep 10 15:31:10 CEST 2007


On Mon, 2007-09-10 at 13:11 +0000, Harshad Modi wrote:
> thx for Reply ,
> but I need some basic knowledge . how to encoding ? which algorithm
> use for that . bz my data has some special char , i have not
> confidence   this function got proper result. i want to make my own
> function  / script for encoding.

For basic knowledge about Unicode and character encodings, I highly
recommend amk's excellent Unicode How-To here:
http://www.amk.ca/python/howto/unicode

Once you've read and understood the How-To, I suggest you examine the
following:

1) Are you *sure* that the special characters in the original file are
latin-1 encoded? (If you're not sure, try to look at the file in a HEX
editor to see what character codes it uses for the special characters).
2) Are you sure that what you were using to look at the result file
understands and uses UTF-8 encoding? How are you telling it to use UTF-8
encoding?

Hope this helps,

-- 
Carsten Haese
http://informixdb.sourceforge.net





More information about the Python-list mailing list