Opened 12 years ago

Closed 12 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: UI/UX:


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 Changed 12 years ago by mir@…

Have you specified your encoding in your file? See for details.

comment:2 Changed 12 years ago by mdt@…

yes, shure, the python modules contain

# -*- encoding: latin1 -*-

on top. does not help.

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

comment:3 Changed 12 years ago by anonymous

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