Forum Moderators: coopster
I have only sites in US English
and use
charset=iso-8859-1
it sounds like:
the iso-8859-1 charset is well standardized, and suited for html etc.. and it might be the best choice for English written websites?
It is the standard encoding for a lot of lanugages, and come PHP 6 (maybe 5.3?) UTF-8 will be the default encoding for that too. This in itself should be a testament to its use. It just expands character compatibility and makes your application a bit safer in case you do go multilingual.
I personally use UTF-8 and have for years. I have no problems with it either.
My PHP files are all encoded in UTF-8. Use a text editor that lets you alter file encoding, e.g. Notepad++.
Their output is sent in UTF-8 by using a header,
header('Content-type: text/html; charset=UTF-8'); And using htmlentities() with UTF-8 encoding,
function htmlentitiesutf8($text) {
return htmlentities($text, ENT_QUOTES, "UTF-8", false);
} As for MySQL, all my tables are encoded in utf8_unicode_ci.
The MySQL part of creating/storing information is to set the charset to utf8 and your collation can either be utf8_general_ci or utf8_unicode_ci. There is a difference in the collation you choose, along with a tradeoff [dev.mysql.com]. utf8_general_ci is faster, utf8_unicode_ci is more accurate. For what it's worth, the open source package moodle implements utf8_unicode_ci, if I remember correctly. I'm not certain about other packages like WordPress, Joomla, etc. I would have to pull the code. That may give you an idea what mass-implementation packages are using.
The one thing to keep in mind when developing pages for utf8 is the entity encoding, as Sekka has mentioned.
Here is a link to a thread and the very last post has quite a few links in regards to this topic: Unicode Support [webmasterworld.com]
but the real point (in my case) is that DOS now add to my confusion.
Where do I go from there?
Needless to state that I never, on any server, found any problem linked to my encoding type.
I am bookmarking this thread, do not thinkthat I'll be rude by not responding, I am right now leaving the States for two weeks.