Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the "best practice" for choosing character encoding with PHP/MySQL applications?

I'm self-taught php programmer, so I often don't know the "correct" way to do something. I want to normalize my character encoding practices between my PHP, HTML, and MySQL data.

-- live in the US,
-- work on sites for people who speak English,
-- most foreign languages I will encounter are western (Spanish, Italian, French)
-- living near NYC I could encounter Hebrew, Russian, etc. though I'd avoid using their character system and would only use whatever accents necessary to use Latin characters.

Anyone want to comment on which I should choose UTF-8 or ISO-8859-1? Or something else? Chris

like image 376
xtian Avatar asked Jan 21 '23 15:01

xtian


1 Answers

IMHO it's always best to work with UTF-8. Your preferences will not always reflect your users' preferences, which might happen to really like hebrew or Russian. שלום!

like image 165
ozk Avatar answered Jan 30 '23 09:01

ozk