NYCPHP Meetup

NYPHP.org

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

Anirudhsinh Zala arzala at gmail.com
Wed May 23 23:46:48 EDT 2012


On Wednesday 23 May 2012 20:41:15 Eugenio Tacchini wrote:
> Hi all,
> I need to distribute an application that potentially can be used with
> many different DBMSs (such as MySQL, PostgreSQL, SQLite, Microsoft SQL
> Server). The charset used in the databases can be ANY.
> 
> I would like to always output UTF-8 text when possible and my
> questions are about the current best practices to handle this kind of
> application with PHP.
> 
> 1) As far as I know, PHP still doesn't support natively utf-8 so to
> avoid problems with string functions, I still have to use mbstring
> fucntions, am I right? What does PHP 5.4 change about that?
> 
> 2) How to handle the fact that the data I receive from the database
> can be stored using any possible charset? Do I need iconv functions
> and convert everything in utf-8? And then convert it back in the
> original charset when I have to write to the DB?
> 
> Thanks!
> 
> Eugenio

http://arzala.blogspot.in/2007/02/internationalization.html

Although very old, but still quite helpful article I had written addressing exactly this issue. Interetingly some links also points to various NYPHP resources :) Additionally please also consider localizations at 
here http://arzala.blogspot.in/2007/02/localization.html

Thanks

Anirudh Zala


> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
> 
> http://www.nyphp.org/show-participation
> 

-- 
Thanks,

Anirudhsinh Zala



More information about the talk mailing list