Loading...
 
Skip to main content

database charset issue

Status
Closed
Subject
database charset issue
Category
  • Error
Feature
Database MySQL (MyISAM)
All / Undefined
Resolution status
Fixed or Solved
Lastmod by
pkdille
Rating
(0)
Description

we're having a charset issue when displaying tikiwiki pages.
The pages themselves are correctly sent as UTF-8: data coming from the localization files is fine.
However, data coming from the tikiwiki database is latin1, and those characters are shown as ? in a lozenge.

The database is encoded as UTF-8, but the default encoding for MySQL, set at build-time, is Latin1. So it appears that there is an implicit conversion done when getting/putting data to and from the DB.
Data received is converted from UTF-8 to Latin1, and data sent is considered to be Latin1 (though it is UTF-8), and converted again: the end result in the database is corrupted again.

It seems that this happens because tikiwiki uses the default charset encoding from the MySQL engine. On another system, with the same MySQL version, but built to use UTF-8 as default (--with-charset=utf-8), there is no problem.

It should probably use the "SET NAMES utf8" command to set the charset encoding, as described there:

http://dev.mysql.com/doc/refman/5.0/en/set-option.htmlQuestion

Software used is:
Solaris 9
Apache 2.2.3
PHP 4.4.4
MySQL 5.0.24a

Priority
25
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
929
Created
Wednesday 08 November, 2006 16:30:00 UTC
by Unknown
LastModif
Monday 06 October, 2008 19:25:51 UTC


Show PHP error messages