unicode issue

gentlestone tibor.beck at hotmail.com
Wed Sep 30 10:54:23 CEST 2009


On 30. Sep., 10:43 h., gentlestone <tibor.b... at hotmail.com> wrote:
> On 30. Sep., 10:35 h., Andre Engels <andreeng... at gmail.com> wrote:
>
> > I get the feeling that the problem is with the Python interactive
> > mode. It does not have full unicode support, so u"Žabovitá zmiešaná
> > kaša" is changed to u'\x8eabovit\xe1 zmie\x9aan\xe1 ka\x9aa'. If you
> > call your code from another program, it might work correctly.
>
> > --
> > André Engels, andreeng... at gmail.com
>
> thx a lot
>
> I spent 2 days of my life beacause of this
>
> so doctests are unuseable for non-engish users in python - seems to be

yes, you are right, now it works:

def slugify(name):
    """
    >>> slugify(u'\u017dabovit\xe1 zmie\u0161an\xe1 ka\u0161a s.r.o')
    u'zabovita-zmiesana-kasa-sro'
    """
    for key, value in _MAP.iteritems():
        name = name.replace(key, value)
    return defaultfilters.slugify(name)



More information about the Python-list mailing list