internationalization problems

Werner Schiendl ws-news at gmx.at
Thu May 2 08:21:56 EDT 2002


Hi,

use the 'right' names for the encodings:

>>> x=u'some text'
>>> x.encode('iso-8859-1')
'some text'
>>> x.encode('iso-8859-2')
'some text'
>>>

hth
Werner


"Johann" <programisci at NOSPAM.murator.com.pl> wrote in message
news:ll82du4mpokdus8oo4rsshsqv43tgheqqp at 4ax.com...
> I want to prepare multi platform application which can work in
> Windows, Linux and MacOS. The problem is I cannot relay on utf-8
> charset because older computers cannot display it correctly. So I need
> to implement codec for 3 different charsets because Windows uses
> window-1250, Linux uses  iso-8859-2 and Mac uses its own different
> coding for Polish characters (I assume, my application will be in
> Polish characters native to each platform).
>
> I thought it would be good to use codec library, but I have almost no
> examples in manual how to use it. I have also no experience with this
> library. Is it good idea to choose it? Maybe I should choose another
> way?
>
> I have also problem with converting from utf-8 into window-1250 or
> iso-8859-2 (latin-2). E.g.
>
> x = u'some text'
> x.encode('latin-1')
> # it works but.... I need latin-2...
> x.encode('latin-2')
> #It does not work :-(
> #err: LookupError: unknown encoding
>
> --
> Johann





More information about the Python-list mailing list