Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Thorsten Kampe (Mon, 2 Apr 2007 16:05:25 +0100) > * Steven Bethard (Sun, 01 Apr 2007 10:21:40 -0600) > > Thorsten Kampe wrote: > > I'm not very experienced with internationalization, but if you change:: > > > > gettext.install('test') > > > > to:: > > > > gettext.install('test', unic

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Damjan (Mon, 02 Apr 2007 18:29:06 +0200) > > Actually rxvt, Poderosa and console have the ability to display non- > > ASCII characters. I use the dejavu fonts that support non-ASCII, too. > > > > But the problem is even simpler: I can't even set the standard Windows > > console ("cmd") to Window

Re: I18n issue with optik

2007-04-02 Thread Damjan
> Actually rxvt, Poderosa and console have the ability to display non- > ASCII characters. I use the dejavu fonts that support non-ASCII, too. > > But the problem is even simpler: I can't even set the standard Windows > console ("cmd") to Windows 1252 in Python. Although directly executing > "chc

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* paul (Mon, 02 Apr 2007 17:49:15 +0200) > Thorsten Kampe schrieb: > [snipp] > > I got the tip to set a different encoding by > > sys.stdout = codecs.EncodedFile(sys.stdout, 'utf-8') > > > > but unfortunately this does not change the encoding of any Terminal. > > So my question is: how can I set

Re: I18n issue with optik

2007-04-02 Thread paul
Thorsten Kampe schrieb: [snipp] > I got the tip to set a different encoding by > sys.stdout = codecs.EncodedFile(sys.stdout, 'utf-8') > > but unfortunately this does not change the encoding of any Terminal. > So my question is: how can I set a different encoding to sys.stdout > (or why can I set

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Jarek Zgoda (Mon, 02 Apr 2007 17:52:34 +0200) > Thorsten Kampe napisa?(a): > > > I can't see the "solution" here. Is the optparse "print_help" function > > wrong? Why should there even be errors if I use "unicode = True" with > > gettext.install? > > > > I have ISO-8859-15 gettext translation

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Steven Bethard (Sun, 01 Apr 2007 10:21:40 -0600) > Thorsten Kampe wrote: > I'm not very experienced with internationalization, but if you change:: > > gettext.install('test') > > to:: > > gettext.install('test', unicode=True) > > what happens? Actually, this is the solution. But t

Re: I18n issue with optik

2007-04-02 Thread Jarek Zgoda
Thorsten Kampe napisał(a): > I can't see the "solution" here. Is the optparse "print_help" function > wrong? Why should there even be errors if I use "unicode = True" with > gettext.install? > > I have ISO-8859-15 gettext translations and I want optparse to display > them correctly. What do I

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Jarek Zgoda (Sun, 01 Apr 2007 22:02:15 +0200) > Thorsten Kampe napisa?(a): > > >>> Under Windows I get " File "G:\program files\python\lib\encodings > >>> \cp1252.py", line 12, in encode > >>>return codecs.charmap_encode(input,errors,encoding_table)" > >> I'm not very experienced with intern

Re: I18n issue with optik

2007-04-02 Thread Thorsten Kampe
* Leo Kislov (1 Apr 2007 14:24:17 -0700) > On Apr 1, 8:47 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > I guess the culprit is this snippet from optparse.py: > > > > # used by test suite > > def _get_encoding(self, file): > > encoding = getattr(file, "encoding", None) > > if not encodin

Re: I18n issue with optik

2007-04-01 Thread Leo Kislov
On Apr 1, 8:47 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > I guess the culprit is this snippet from optparse.py: > > # used by test suite > def _get_encoding(self, file): > encoding = getattr(file, "encoding", None) > if not encoding: > encoding = sys.getdefaultencoding() >

Re: I18n issue with optik

2007-04-01 Thread Jarek Zgoda
Thorsten Kampe napisał(a): >>> Under Windows I get " File "G:\program files\python\lib\encodings >>> \cp1252.py", line 12, in encode >>>return codecs.charmap_encode(input,errors,encoding_table)" >> I'm not very experienced with internationalization, but if you change:: >> >> gettext.insta

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Thorsten Kampe (Sun, 1 Apr 2007 20:22:51 +0100) > * Thorsten Kampe (Sun, 1 Apr 2007 20:08:39 +0100) > > * Thorsten Kampe (Sun, 1 Apr 2007 19:45:59 +0100) > > > Yes, I could do that but I'd rather know first if my code is wrong or > > > the optparse code. > > > > It might be the bug mentioned in

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Thorsten Kampe (Sun, 1 Apr 2007 20:08:39 +0100) > * Thorsten Kampe (Sun, 1 Apr 2007 19:45:59 +0100) > > Yes, I could do that but I'd rather know first if my code is wrong or > > the optparse code. > > It might be the bug mentioned in > http://mail.python.org/pipermail/python-dev/2006-May/06545

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Thorsten Kampe (Sun, 1 Apr 2007 19:45:59 +0100) > Yes, I could do that but I'd rather know first if my code is wrong or > the optparse code. It might be the bug mentioned in http://mail.python.org/pipermail/python-dev/2006-May/065458.html The patch although doesn't work. From my unicode-chars

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Steven Bethard (Sun, 01 Apr 2007 10:26:54 -0600) > Thorsten Kampe wrote: > > I guess the culprit is this snippet from optparse.py: > > > > # used by test suite > > def _get_encoding(self, file): > > encoding = getattr(file, "encoding", None) > > if not encoding: > > encoding = sy

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Steven Bethard (Sun, 01 Apr 2007 10:21:40 -0600) > Thorsten Kampe wrote: > > * Steven Bethard (Sat, 31 Mar 2007 20:08:45 -0600) > >> Thorsten Kampe wrote: > >>> I've written a script which uses Optik/Optparse to display the > >>> options (which works fine). The text for the help message is local

Re: I18n issue with optik

2007-04-01 Thread Steven Bethard
Thorsten Kampe wrote: > I guess the culprit is this snippet from optparse.py: > > # used by test suite > def _get_encoding(self, file): > encoding = getattr(file, "encoding", None) > if not encoding: > encoding = sys.getdefaultencoding() > return encoding > > def print_help(se

Re: I18n issue with optik

2007-04-01 Thread Steven Bethard
Thorsten Kampe wrote: > * Steven Bethard (Sat, 31 Mar 2007 20:08:45 -0600) >> Thorsten Kampe wrote: >>> I've written a script which uses Optik/Optparse to display the >>> options (which works fine). The text for the help message is localised >>> (with german umlauts) and when I execute the script

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
I guess the culprit is this snippet from optparse.py: # used by test suite def _get_encoding(self, file): encoding = getattr(file, "encoding", None) if not encoding: encoding = sys.getdefaultencoding() return encoding def print_help(self, file=None): """print_help(file : f

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
Just an addition : when I insert this statement... print _('THIS SOFTWARE COMES WITHOUT WARRANTY, LIABILITY OR SUPPORT!') into this skript, the line is printed out. So if my Skript can output the localised text but Optparse can't it should be an optparse bug, right?! Thorsten -- http://mail.p

Re: I18n issue with optik

2007-04-01 Thread Thorsten Kampe
* Steven Bethard (Sat, 31 Mar 2007 20:08:45 -0600) > Thorsten Kampe wrote: > > I've written a script which uses Optik/Optparse to display the > > options (which works fine). The text for the help message is localised > > (with german umlauts) and when I execute the script with the localised > >

Re: I18n issue with optik

2007-03-31 Thread Steven Bethard
Thorsten Kampe wrote: > I've written a script which uses Optik/Optparse to display the > options (which works fine). The text for the help message is localised > (with german umlauts) and when I execute the script with the localised > environment variable set, I get this traceback[1]. The intere

I18n issue with optik

2007-03-31 Thread Thorsten Kampe
Hi, I've written a script which uses Optik/Optparse to display the options (which works fine). The text for the help message is localised (with german umlauts) and when I execute the script with the localised environment variable set, I get this traceback[1]. The interesting thing is that the