Finally, the answers to MySQL database questions about which character set to use, what's the difference between character set, and what's collation and which one to use?
Read More...
Since we're already here, I might as well show you too that we should take a look
around here in PHPMyAdmin and we want to see that:
MySQL charset: UTF-8 Unicode (utf8)
If you plan on using Asian characters such as
Japanese and Chinese in your database, then make sure these (everywhere possibly mentioned) are set to
UTF-8 Unicode (utf8) .
And now a FAQ answered here: UTF-8 General_ci is also ok, but there's
some difference when searching through a database in terms of the
ascending/descending/character value equality sort and search ordering. ( _ci means 'case
insensitive'.)
Just in
case you're curious and wanted to know... It took me a long time of searching to find out,
though... just another one of those things that don't make a significant
difference to my life even when I know it, but when I don't know it, I just
can't let go of it. (Sigh...)
What's more relevant, and more likely, though, is
that the tables in your database would most probably show latin1_swedish_ci especially on your remote webhost, as a
default.
FAQ reason: this is because MySQL AB is a Nordic
company.
That just means that the data is
being stored in your database as single-byte ASCII characters, and not
as double-byte Unicode characters.
Keep in mind that there are two places where charset is used
charset used for Collation
charset used Data actually stored in your
database!
And that's just about the
collation: that's just how the database fetches data stored in
your database.
This is not all, when you actually create your
database, you have to make sure that for future lack of headaches, you have to
make sure the data itself that is stored in
your database is also in UTF-8 Unicode.
By default, perhaps many webhost Cpanels will
create your database to store in latin1_swedish_ci. You may need to take some manual steps to make
everything UTF-8 Unicode, which I do know and have
done before. I'll just say, just buzz me, supposing if you had actually decided
to do all of the above for yourself!
So do we actually need to care about all that?
Thankfully, I would say no, even if your database is not set to store in unicode
but in latin1_swedish, you can still store and serve Japanese characters on your
Joomla site, for the most part. Only some things like post titles might not be
readily shown as Japanese characters but as gibberish, but this depends on your
browser - usually IE screws this up. So if you
are not incorrigibly obsessive-compulsive, then 99.9% of the time, you can live
a happy life not bothering about all this.
Unless you want to directly enter Asian text in your database through
the PMA interface and not through the Joomla interface, then it would
be better if it's specified that your tables are storing data as
Unicode characters.
And there you have it! A local webhost server for
you to test your PHP scripting, Joomla, Wordpress and stuff on, before doing the
same for your live site. (Or actually deciding that you actually want
to have one, now.)
FAQ reason: this is because MySQL AB is a Nordic company.
OOOOOOOOOOOh... so desu ka....
Quote:
Only some things like post titles might not be readily shown as Japanese characters but as gibberish, but this depends on your browser - usually IE screws this up.
Yeah... hate it!
Quote:
even if your database is not set to store in unicode but in latin1_swedish, you can still store and serve Japanese characters on your Joomla site, for the most part.
Yup.. coz whatever characters inside the database regardless of their encoding inside the db is collated and fetched out as UTF-8.. just need to ensure that your site template's charset is also set to UTF-8, as mentioned in another comment.
But I guess most commercial blog services like blogger, xanga, multiply, would already have their default template's charset set as UTF-8 already. So only people who are into doing their own site templates or checking/modifying other ppl's need worry..
Just to add to the article - to those who want to use non-English characters - not only Asian languages, but also German, French, Norsk etc. in their website, not only should they set their MySQL DB as mentioned, but also ensure in their website template that the webpage itself is not encoded in the default iso-8859-1 charset, but as "UTF-8".
Check for this line in your page source
and ensure charset is UTF-8:
meta http-equiv="Content-Type" content="text/html; charset=UTF-8"
Chinese Dictionary S...
Wow.. will download and try! XD
First Steps after in...
re: XAMPP vs. WAMP - I am not sure ...
MySQL database Chara...
Just to add to the article - to those...
First Steps after in...
XAMPP vs. WAMP - Thanks for sharing t...
MySQL database Chara...
Not only Joomla, everything else sho...