[Zope3-dev] Re: unicode problems !?

Albertas Agejevas alga at akl.lt
Fri Oct 8 08:05:08 EDT 2004


On Fri, Oct 08, 2004 at 01:35:13PM +0200, j.kartnaller wrote:
> Stephan Richter wrote:
> >On Friday 08 October 2004 03:01, j.kartnaller wrote:
> >>If a doc-string contains non ascii data (eg. german umlaut) I get the
> >>following error :
> >>
> >>UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 4:
> >>ordinal
> >>not in range(128)
> >If you have umlauts in the doc string, you must make it a unicode text. 
> >Example:
> >
> >def func():
> >    u"""This is the docstring with an umlaut: ü"""
> >
> >The doc tool has no way of guessing the encoding you may have used.
> >
> I tried this without a change in the behavior !

Have you declared the charset at the top of the source file?

#!/usr/bin/env python
# -*- charset: latin-1 -*-

Albertas


More information about the Zope3-dev mailing list