Opened 18 years ago

Closed 18 years ago

#1715 closed defect (invalid)

charset problems with umlaut from pythoncode (i.e. verbose_name="")

Reported by: mdt@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

i used a line

geaendert = meta.DateTimeField(verbose_name="Änderungsdatum", ....

and got questionmarks on the page showing that name. on the same page other umlauts (coming from djangos localization) where shown correctly. i moved to

geaendert = meta.DateTimeField(verbose_name=u"Änderungsdatum", ....

which immediatly gives the error

UnicodeDecodeError 'ascii' codec can't decode byte 0xe4 in position 65: ordinal not in range(128)

. so i switched back to the first version for now. i changed a field with a name including an umlaut and now i get another error:

OperationalError at /admin/ Could not decode to UTF-8 column <unknown column name> with text �nderungsdatum und Beschreibung geändert

Change History (3)

comment:1 by mir@…, 18 years ago

Have you specified your encoding in your file? See http://www.python.org/peps/pep-0263.html for details.

comment:2 by mdt@…, 18 years ago

yes, shure, the python modules contain

# -*- encoding: latin1 -*-

on top. does not help.

i solved it with a sitecustomize.py in the pythonpath setting sys.setdefaultencoding('utf-8') - perhaps this should be mentioned in the docs somewhere?

comment:3 by anonymous, 18 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top