Hej
En kollega i USA og jeg arbejder på en WordPress site. Splinterny. Hun har knoklet for at vælge et tema, og alt skulle være klart nu. Så er hun løbet ind i charset problemer. Jeg har set en tråd om en UTF-8 convertor og vi skal prøve det når hun vågner, men jeg ved ikke om det er faktisk det. Kan nogen hjælpe? Her er hvad hun skriver:
Vi er på Dreamhost og tog anbefalet default utf8_unicode_ci for charset.
Når man logger ind, får man:
"The mbstring PHP extension was not found and you seem to be using a multibyte charset. Without the mbstring extension phpMyAdmin is unable to split strings correctly and it may result in unexpected results."
Først panel under mysql spalte har vi MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci
Iflg Dreamhost hjælp vi sat connection collation to utf8_bin. Fejlmeddelsen var der endnu. Andre foreslår at ændre latin1 til utf8 men hvordan.
Og - ta da - database siger nu at Collation is latin1_swedish_ci !!!???
(index.php i mysql)
I Server Variables and Settings kan man se mange instanser af latin1 og latin1_swedish_ci. De kan highlightes men kan ikke skiftes til utf8.
Server variables and settings
Variable Session value / Global value
auto increment increment 1
auto increment offset 1
automatic sp privileges ON
back log 50
basedir /data/mysql/gnatek/
binlog cache size 32,768
bulk insert buffer size 8,388,608
character set client utf8
(Global value) latin1
character set connection utf8
(Global value) latin1
character set database latin1
character set filesystem binary
character set results utf8
(Global value) latin1
character set server latin1
character set system utf8
character sets dir /data/mysql/gnatek/share/mysql/charsets/
collation connection utf8_bin
(Global value) latin1_swedish_ci
collation database latin1_swedish_ci
collation server latin1_swedish_ci
completion type 0
concurrent insert 1
connect timeout 5
datadir /dh/mysql/gnatek/data/
date format %Y-%m-%d
datetime format %Y-%m-%d %H:%i:%s
default week format 0
delay key write ON
etc., etc.
En bruger kommentar fra 25 January 2008 i help siger
<http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html>
When you change the charset of a table, every column is explicitly set to take the *old* charset - even if the columns in your tables all took the default charset! You will need to issue ALTER TABLE statements for every column, or dump the database to file and replace all the character set references. I did the latter with three text
replacements:
Change table-specific charsets
Replace: " DEFAULT CHARSET=latin1"
With: " DEFAULT CHARSET=utf8"
Remove any column-specific charsets
Delete all occurrences of: " character set latin1"
Change all char's to varchar's because char has to store 3
bytes/character in utf8 while varchar can store 1
for short characters
Replace: " char("
With: " varchar("
You might want to search for "latin1" and see if anything else needs
to be changed. Then follow the instructions
above and everything will be fine. Hopefully this will save someone
else a day's worth of trouble.
Men der er ingen DEFAULT CHARSET linie i Collations table.
Hjælp! Er der nogen der har erfaring/idéer? Det hele er splinterny så vi kunne være barsk og gå tilbage til 0. Skal vi virkelig det?
På forhånd MANGE TAK!!