Problem with i18n

Thorsten Kampe <[email protected]> Sat, 31 Mar 2007 22:49:33 +0100
Newsgroups gmane.comp.python.optik.user
Message-ID <[email protected]>
Hi,

this list has been fairly quiet for months so I hope someone's still 
reading this list...

Okay, 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 localised optparse messages from displays fine - 
it's only my localisation that errors.

What can I do to troubleshoot whether the culprit is my script, optik 
or gettext?

Would it make sense to post the script and the mo or po files?


Thorsten

[1]
Traceback (most recent call last):
  File "script.py", line 37, in <module>
    options, args = cmdlineparser.parse_args()
  File "/usr/lib/python2.5/optparse.py", line 1378, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1418, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1493, in 
_process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.5/optparse.py", line 782, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.5/optparse.py", line 804, in take_action
    parser.print_help()
  File "/usr/lib/python2.5/optparse.py", line 1648, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 
264: ordinal not in range(128)


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV