Code

Opened 8 years ago

Closed 8 years ago

#1715 closed defect (invalid)

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

Reported by: mdt@… Owned by: adrian
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:

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

Attachments (0)

Change History (3)

comment:1 Changed 8 years ago by mir@…

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

comment:2 Changed 8 years ago by mdt@…

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 Changed 8 years ago by anonymous

  • Resolution set to invalid
  • Status changed from new to closed

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.