unicode - Python conversion to ISO-8859-5 -
I am having problems while trying to insert UTF-8 file (insert Russian characters) in ISO-8859-5 File: The 'charmap' codec can not encapsulate the character. In the 'Uffe' situation, is it possible for anyone to know what 0 (0) is wrong (?):
def converter (): try: import codec data = codecs.open ('in.txt', 'r', 'utf-8'). Except Exceptions (E: Print e sys.exit (1) F = Open (try 'out', 'W'): f.write (data.encode ('iso- 885 9-5')) Except exception, e: print e finally: f.close ()
"in.txt": ё! -№% «» (Ideiofoceph; нцхз
FIFA is a character.
Before encoding in -8859-5, it must be deleted from its data variable.
Comments
Post a Comment