Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#9510 closed (invalid)

admin console CRUD operation reject unicode charactors

Reported by: justicejiang@… Owned by: nobody
Component: contrib.admin Version: 1.0
Severity: Keywords: admin Chinese error
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I test this on mysql. I create a model and a table in mysql, registered it on admin console.
I try input Chinese charactor with add function, and exceptin thrown like:
Warning at /admin/act/acttype/add/
Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'type_name' at row 1

But the record can is created, with "?" character instead of normal input.

I'd tried to modified the characterset of the table from "latin" to "utf8", but still the same. I'd also tried "gbk" charset, no change at all.

Also the edit and delete function has the same exception throws. I think we should add a setting param to tell the program how to encode or decode the db input/output before db operations.

To show the error for you I'd uploaded the warning page in the attachment list, please have a look.

Attachments (1)

Warning at -admin-act-acttype-add-.rar (17.4 KB) - added by justicejiang@… 7 years ago.
Error warning page when adding record with Chinese character input

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by justicejiang@…

Error warning page when adding record with Chinese character input

comment:1 Changed 7 years ago by kmtracey

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

Please take this to the django-users mailing list. The problem you are having is a database configuration issue, not a Django bug. Django handles Chinese characters just fine, the error you are getting is because your database table is using a character set that has no representation for these characters. I do not believe the command you issued to change the table charset worked; if you give details of exactly what command you issued someone on django-users may be able to provide the right one to truly convert the table columns to utf8.

comment:2 Changed 7 years ago by anonymous

  • milestone post-1.0 deleted

Milestone post-1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top