Re: [BangPypers] Internationalization in Python 2.6

2013-11-27 Thread Vivek Puri
Hi, Actually in the earlier part when we write to xml we got which was correct when we look into the ISO-8859-1 (Latin-1) international character set and hexadecimal. But here we got the hexa instead. Again for another character which can not be decoded using utf-8 it is giving the same valu

Re: [BangPypers] Internationalization in Python 2.6

2013-11-27 Thread Dileep
Hi Vivek, Thanks for the reply. Yes I tried the same earlier itself. In that case problem is the input string decode with one encoding format and when it encode into a byte string using utf-8 the resulting string is not matching with the input string. Without specifying the encoding format also,

Re: [BangPypers] Internationalization in Python 2.6

2013-11-27 Thread Vijay Ramachandran
On Wed, Nov 27, 2013 at 4:30 PM, wrote: > I have an input string to the script. I do not know the encoding of the > string. > Instead of guessing the encoding like you're doing, you should use a library like https://pypi.python.org/pypi/chardet Once the encoding is detected, you will need to ch

Re: [BangPypers] Internationalization in Python 2.6

2013-11-27 Thread Vivek Puri
Hi, How the internationalization works in Python 2.6. Internationalization is different topic. Here you are dealing with character encoding. You are actually on right track except this line: write_to_xml(input_string_unicode, encoding) change it to write_to_xml(input_string_u

[BangPypers] Internationalization in Python 2.6

2013-11-27 Thread Dileep
Hi, How the internationalization works in Python 2.6. I have an input string to the script. I do not know the encoding of the string. I want to write that string to an xml file. Here I am trying different encoding formats to decode the input string and make it as unicode. Then using the same e