NYCPHP Meetup

NYPHP.org

[nycphp-talk] UTF-8, databases and best practices

Eugenio eugenio at favoriti.it
Fri Jun 8 04:03:16 EDT 2012


2012/5/23 Hans Zaunere <bulk at zaunere.com>

I'd be interested to hear other's thoughts, but the general consensus these
> days is "convert all to UTF-8".  Is there an application-requirement-reason
> that you'd need to convert data to a different charset at different times?
>
> In general:
>
> 1. Raw data (any charset/encoding)
> 2. Detect and convert to UTF 8, clean-up, etc.
> 3. Store in database/etc
> 4. Read/display in UTF 8
>

** If you have already received this message: sorry, I had problems posting
here with gmail and I couldn't realize if my message was correctly posted,
so I'm trying again with another email **

Hi all and thanks for the interesting answers!
The problem 2) is still the one I'm not completely sure about; in
almost all your answers you suppose I can decide how to setup the
database but it is not the case. This application has to work with any
database settings, I can't force the users to ALTER the database
charset and make it UTF-8.
So should I have to read and convert on the fly (using PHP ICONV) to
UTF-8 from the database and then convert it back again before writing?
I can't just assume to work with UTF-8, right?

Thanks again.

Eugenio

--------------------
DaDaBIK  - Database Interfaces Kreator
http://www.dadabik.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20120608/5cb1c9b5/attachment.html>


More information about the talk mailing list