Prev | Current Page 225 | Next

Marc Delisle

"Mastering phpMyAdmin 2.11 for Effective MySQL Management"


Character Sets and Collations
[ 256 ]
Choosing the Effective Character Set
Now, we set $cfg['AllowAnywhereRecoding'] to TRUE. Then, we choose English
(en-utf-8) in the Language selector. The Home page has changed:
The MySQL Charset choice appears only if the current chosen Language uses utf-8
encoding. From now on, every communication that occurs between the web server
and the MySQL server will use this MySQL character set.
The choice of character set is remembered for 30 days using a cookie
mechanism. Depending on where the cookies are stored (on the local
computer or on a network server), the character set may need to be
chosen again if we log into phpMyAdmin from another computer.
The Impact of Switching
When we choose a character set, all the data stored in MySQL will be recoded with
this character set. If we subsequently change the character set used by phpMyAdmin,
we will get incorrect results when fetching the data. There is no easy way of finding
which character set was used to store a particular row of data.
Here is an example with our author table. We first create a new author with a
character ?© in his name:
Chapter 17
[ 257 ]
There is no problem here when inserting, browsing, or searching for this new author,
as the chosen character set, iso-8859-1, can deal with the ?© character.
However, if we switch the MySQL character set to UTF-8 later on, we will have a
problem when browsing the author table:
The same problem occurs when we switch from one language to another, if
$cfg['AllowAnywhereRecoding'] is set to FALSE, and the two languages are
encoded in different character set.


Pages:
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237