Re: [Py2exe-users] utf-16
by David Fraser other posts by this author
Jun 15 2004 11:54AM messages near this date
[Py2exe-users] Re: utf-16
|
Re: Re[2]: [Py2exe-users] How to place all modules inside .exe?
R.Rossbach@[...].de wrote:
> Hello
>
> if have a function which converts uft-16 to latin-1
>
>
> import codecs
>
> def Uni2Latin(datei):
> try:
> inFile = codecs.open(datei, 'r', encoding="utf-16")
> outFile = codecs.open(datei+'.txt', 'w', encoding="Latin-1")
> lines = inFile.readlines()
> outFile.writelines(lines)
> inFile.close()
> outFile.close()
> return True
> except:
> return False
>
> This works fine, but if I use this func. in a program made by py2exe this functions is not
able to open a utf-16 files.
>
> Any advice would be appreciated
>
> Thanks
>
> richard rossbach
>
>
Try and include "encodings" in the list of packages you give to py2exe
(-p encodings on the command line or in the options dictionary).
Then it should work
David
-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
Py2exe-users mailing list
Py2exe-users@[...].net
https://lists.sourceforge.net/lists/listinfo/py2exe-users
Thread:
Thomas Heller
David Fraser
|