Re: utf-8 ?
| From: | PJ | Date: | Mon, 27 Apr 2009 14:47:51 +0000 |
| Subject: | Re: utf-8 ? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-292024@lists.php.net to get a copy of this message | ||
Nathan Rixham wrote:
> PJ wrote:
>> Since I have to use a number of Western languages that have those
>> annoying accents on many characters, I am already finding some
>> annoyances in my code results; like having to enter the á type of
>> stuff in inputs for searches & queries.
>> MySql db is set up for InnoDB with latin1_swedish_ci for Collation; I
>> believe this is default.
>
> in that case you'd have to convert all your databases to utf8 /
> utf_general_ci
>
>> Utf-8 seems to be one way to overcome the problems, but is it the only
>> way - seems a little cumbersome as I have no need for oriental & other
>> extra-terrestrial cyphers. (I'm incorrigibly lazy.)
>
> can't think of any good reason why you shouldn't be using utf-8..
>
>> If it is the only way, what difficulties could I expect from an ISP
>> hosting a virtual site?
>
> none really AFAIK - but converting all your latin1 to utf-8 will be a
> very fun job indeed!
>
I looked at http://developer.loftdigital.com/blog/php-utf-8-cheatsheet
which suggests this:
ALTER DATABASE db_name
CHARACTER SET utf8
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
DEFAULT COLLATE utf8_general_ci
;
ALTER TABLE tbl_name
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci
;
or I could do it with phpMyAdmin, right?
and the only difficulties would appear to be fixing any accent stuff
(don't know yet just what) and that would only be time consuming.
I guess I'm just looking for reassurance that I don't muck up anything
and then have to do tortured acrobatics to redress things again. :-)
--
Hervé Kempf: "Pour sauver la planète, sortez du capitalisme."
-------------------------------------------------------------
Phil Jourdan --- pj@ptahhotep.com
http://www.ptahhotep.com
http://www.chiccantine.com/andypantry.php