Track issues with MySQL 5.0, charset/collation work etc on this bug.
Version: unspecified
Severity: normal
Track issues with MySQL 5.0, charset/collation work etc on this bug.
Version: unspecified
Severity: normal
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T5738 MySQL 5.0 issues (tracking) | |||
Declined | • brooke | T5735 Error on creating Default Database (MySQL 5.0 strict mode) | |||
Resolved | None | T5786 Use utf8 connection charset for mysql >= 4.1 | |||
Resolved | None | T9669 should not use default value for MySQL BLOB/TEXT columns | |||
Resolved | None | T3322 "1071: Specified key was too long" (MySQL error) during installation | |||
Resolved | None | T8737 tables.sql failing for MySQL 5.0.22 | |||
Declined | None | T17851 If the install exists $wgDBmysql5 should be set based on the existing collation |
andy wrote:
I'm using mediawiki-1.5.0 with MySQL 4.1.14, which is set to use UTF8 as the
default charset. However, because most other old web apps here use Latin1, the
default connection charset is set to Latin1 (in my.cnf: init-connect = 'set
names latin1'). I.e. the MySQL server keeps everything in UTF8, but talks Latin1
by default to the clients. Because mediawiki is fully capable of using UTF8, it
can/should talk UTF8 directly with the database, so I changed
includes/Database.php to tell MySQL that mediawiki wants to talk UTF8:
+++ wiki/includes/Database.php 2005-10-23 19:06:24.000000000 +0200
@@ -223,6 +223,7 @@
$user, $password );
}
+ $this->query('SET NAMES utf8');
} if ( $dbName != '' ) {
This works fine, but should probably have an additional check like: if
mysql_version >= 4.1 then send "set names utf8".
mediawiki-1.5.0 was also able to display everything correctly while talking
Latin1 with our database, but I suppose in that case mediawiki did the
translation from latin1 to utf8 (because pages were displayed in utf8). I
suppose, letting the database to the translation scales better than changing
encodings in PHP. Also there was a minor glitch with pages that have german
umlauts in their name. The page links were displayed in red (not existing), even
if they existed. And if you click the link, the edit page came up and the
textbox was filled with the content of the existing page.
Please do not place specific comments on this bug, this is a tracking bug. File new
bugs, and list this bug as dependent on it.