Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10994 closed (invalid)

Flat page content with unicode causes fatal error but data is still commited

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

Description

Hi ,
I'm creating a flatpage through the admin ui and when I add the content I get a

Warning Incorrect string value

However data does get added to the database which I can see through phpmyadmin.

Maybe better unicode escaping can be done if this is not a MYSQL error. Also data shouldn't get added to the DB if an error is thrown.

Thanks,
Alp

Change History (2)

comment:1 Changed 6 years ago by kmtracey

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

It sounds like the character set for your table is the MySQL default latin1. When you try to store some Unicode value that cannot be represented in latin1 you will get "incorrect string value" from MySQL, because there simply is no way to represent some Unicode data in latin1. There is no bug with Django here, the problem is your database. The fix is to convert your table to use utf8 as the character set. Here's the MySQL doc for how to do that: http://dev.mysql.com/doc/refman/5.1/en/alter-table.html. Specifically, see the "CONVERT TO CHARACTER SET" part.

comment:2 Changed 6 years ago by gsong

  • Summary changed from Flay page content with unicode causes fatal error but data is still commited to Flat page content with unicode causes fatal error but data is still commited
Note: See TracTickets for help on using tickets.
Back to Top