[Mediawiki-l] After upgrade to 1.17 problems with templates with german umlauts

Bastian Timmermann bastian.timmermann at innogames.de
Thu Aug 11 17:49:28 UTC 2011


Hi,

you have a Problem with encoding, There are several ways to solve this.

DO A BACKUP!!!


The easiest way is to be sure, that all encoding settings are set to UTF-8.
* Locales
* Set in LocalSettings.php  to $wgOutputEncoding = 'UTF-8'

Please check which variables are set in your database and check in which 
character set you db is. (SHOW VARIABLES LIKE '%character%'; and
SHOW VARIABLES LIKE '%collation%';)


If not create the DB new (before create a dump) with following 
additional command

create database $DB CHARACTER SET utf8 COLLATE utf8_general_ci;

This was the first step!


The second one is to try to convert the mysqldump with iconv

see man iconv (don't know it by heart)


The last step which is to replace all malformed Strings with new good 
strings in the dump.
Before doing this; please double check, if the database is completly in 
UTF-8.

DO A BACKUP!!!

To replace strings do following:

sed -i s/"ü"/ü/ $DUMP
sed -i s/"ä"/ä/g $DUMP
sed -i s/"ö"/ö/g $DUMP
sed -i s/"ß"/ß/g $DUMP
sed -i s/"Ä"/Ä/g $DUMP
sed -i s/"„"/"„"/g $DUMP
sed -i s/"“"/"“"/g $DUMP
sed -i s/"–"/"-"/g $DUMP

This works finally for me, maybe you have to adapt these strings to you 
needs. You find out the values with the tool less NOT with vim or cat.


Regards


Bastian


On 11.08.2011 18:11, Norbert Schneider wrote:
> Hi,
>
> after upgrade from 1.16.5 to 1.17.0 all my entries based on templates with german umlauts disappeared.
>
> Example:
> Template:Täglich is changed to Template:Täglich
>
> I can't find the reason. Database link problem? Database table templatelinks is unchanged. In the editor the entry {{Template:Täglich}} is displayed correctly.
>
> Produkt	Version
> MediaWiki 1.17.0
> PHP	5.3.3 (apache2handler)
> MySQL	5.1.52
> Centos 5.6
>
> Many thanks for your help.
>
> Norbert
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l



More information about the MediaWiki-l mailing list