Edgewall Software
Modify

Ticket #9766 (closed defect: fixed)

Opened 19 months ago

Last modified 4 months ago

Supplemental Characters not supported

Reported by: Steven R. Loomis <srl@…> Owned by: jomae
Priority: normal Milestone: 0.12.3
Component: database backend Version: 0.12.1
Severity: normal Keywords: mysql unicode documentation
Cc:
Release Notes:
API Changes:

Description

I tried to import (and later, just paste) the following into a ticket

http://www.goog𝓁e.com/>
may look like "www.google.com" if appropriate fonts are installed. The nameprep algorithm is supposed to translate '𝓁' into a lowercase L character but is not doing so.

mysql, trac 0.12.1

got this errr

/xsrl/src/trac/trac/db/util.py:65: Warning: Incorrect string value: '\xF0\x9D\x93\x81e….' for column 'newvalue' at row 1

return self.cursor.execute(sql_escape_percent(sql), args)

Attachments

Change History

comment:1 follow-up: Changed 19 months ago by cboos

What "kind" of mysql? (see MySqlDb#MySQL for the SHOW ... statement)

But this rather looks like a MySQL limitation, as on PostgreSQL it obviously works…

comment:2 in reply to: ↑ 1 Changed 19 months ago by Steven R. Loomis <srl@…>

Replying to cboos:

What "kind" of mysql? (see MySqlDb#MySQL for the SHOW ... statement)

But this rather looks like a MySQL limitation, as on PostgreSQL it obviously works…

InnoDB, utf8/utf8_bin (as per 'SHOW…'.

Well, maybe we're going to move to postgresql before we even try moving to mysql.

Also, why is this a 'warning'? An 'error' would be better, because it results in truncated inserts.

comment:3 Changed 19 months ago by Steven R. Loomis <srl@…>

Looks like it needs to be utf8mb4 not utf8: http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html - only available in mysql 5.5

comment:4 Changed 19 months ago by cboos

  • Component changed from general to database backend
  • Keywords mysql unicode documentation added
  • Milestone set to unscheduled

For turning the warning into an error:

warnings.filterwarnings("error", "Incorrect string value",
                        MySQLdb.exceptions.Warning)

(untested)

But this looks more like a documentation issue to me, we should just make that clear in the MySqlDb page, once someone has verified that utf8mb4 works as expected with Trac. Btw, utf16 and utf32 should also work.

comment:5 Changed 4 months ago by jomae

  • Milestone changed from unscheduled to 0.12.3
  • Resolution set to fixed
  • Status changed from new to closed

Supported utf8mb4 charset in [10961].

For Supplemental Characters, it needs MySQL 5.5+, utf8mb4 charset and utf8mb4_bin collation.

CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

comment:6 Changed 4 months ago by jomae

  • Owner set to jomae
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jomae. Next status will be 'closed'
Author


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

 
Note: See TracTickets for help on using tickets.