An UTF8 oddity
Posted by: Chris Devine
Date: February 23, 2016 11:00AM

Hello all. I am in the middle of upgrading a Perl/Catalyst/MySQL web all to use UTF8. All is going well except a problem saving to a table. I have traced that the UTF8 data is good up to (and into) MySql.

Table definition (partial):
CREATE TABLE `tblJD` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`GeneralDescription` longtext COLLATE utf8mb4_unicode_ci,
PRIMARY KEY (`ID`),
) ENGINE=InnoDB AUTO_INCREMENT=2476 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

In the General Query log all is well: UPDATE tblJD SET generaldescription = 'Descripción' WHERE ( id = '2482' )

But if I do:
mysql> select GeneralDescription from JobDescriptions.tblJD WHERE ( id = '2482' );
+--------------------+
| GeneralDescription |
+--------------------+
| Descripción |
+--------------------+
1 row in set (0.00 sec)

Oddly if I do:
mysql> UPDATE JobDescriptions.tblJD SET generaldescription = 'Descripción' WHERE ( id = '2482' );
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select GeneralDescription from JobDescriptions.tblJD WHERE ( id = '2482' );
+--------------------+
| GeneralDescription |
+--------------------+
| Descripción |
+--------------------+
1 row in set (0.00 sec)


I would think if it got to the GQ log correctly, it should be in the field correctly.

What more info can I supply? What is going on?

TIA,
Chris

Options: ReplyQuote


Subject
Views
Written By
Posted
An UTF8 oddity
1904
February 23, 2016 11:00AM
972
February 23, 2016 12:45PM
880
February 26, 2016 09:11PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.