Umlauts revisited: Now they prevent program from running
Franz GEIGER
fgeiger at datec.at
Fri Jan 26 09:48:30 EST 2001
Wow! Both of yours - Alex and Michael - did the trick! Thanks a lot!
Is there another trick to switch globally to this encoding? Or do I have to
check for '\xyz' characters and then encode them?
For now I do a try. If an exception is catched I call the encode method.
Is this the way doing it _always_ if umlauts could come across my way?
That'd be cumbersome because the German language is teeming with umlauts
(o.k., carried it too far ;-))
Best regards
Franz
"Franz GEIGER" <fgeiger at datec.at> wrote in message
news:94rt05$tbe$1 at newsreaderg1.core.theplanet.net...
> I pull data out of an Excel sheet using DAO. There are field values
> containing text strings. Everything works fine until a text reads e.g.
> "Stück".
>
> After stopping before the exception
>
> "UnicodeError: ASCII encoding error: ordinal not in range(128)"
>
> occurs I display the field in the interactive window of PythonWin
> (ActiveState 2.0 on NT4) by simply typing "fld.Value".
>
> It displays u'St\374ck'.
>
> Conversion into a Python string by applying print or str() yields:
>
> "Traceback (innermost last):
> File "<interactive input>", line 1, in ?
> UnicodeError: ASCII encoding error: ordinal not in range(128)"
>
> Any idea how to overcome this?
>
> Best regards
> Franz GEIGER
>
>
>
More information about the Python-list
mailing list