Use of Accented Characters
Posted: Wed Feb 17, 2010 5:10 am
What is the correct settings to get Accented Characters stored and retrieved properly via PHP on a MySQL Database?
I need to get accented characters properly stored and retrieved via PHP on a MySQL Database.
The language is Brazilian Portuguese, but if I use French, for example, the great majority of this set is also present and the problem to set it up properly remains.
The PHP and MySQL Documentation is not of great help in this matter.
Here are the Accented Characters
ç Ç
á é í ó ú ü Á É Í Ó Ú Ü
à è ì ò ù À È Ì Ò Ù
ñ ã õ Ñ Ã Õ
â ê î ô û Â Ê Ô Û
Here is what I end up with in MySQL DB via PHP form
ç Ç
á é à ó ú à É à Ó Ú
à è ì ò ù À È Ì Ò Ù
ñ ã õ Ñ Ã Õ ü Ü
â ê î ô û Â Ê Ô Û não
Here is what more:
Users write a message using accented characters and it does not differ if using a Mac or a PC, if the characters are typed via localized keyboard or using a standard QWERTY and Alt Key to generate these caracters.
Here is the result using something provided in a software called Sequel Pro that encodes using (UTF8 via Latin1) The result is perfect!
Sei que p que se faça uma previsão é preciso q se tenha feito uma retificação de hora, n tenho este curso, e a retificação q fizeram, sinto n ser exata, qual o preço da previsão pelo skype? eu sou grata!
Ordália
Here is the result as Encoding UTF8 (the result is all scrambled as it is if seen by PHPMyAdmin
Sei que p que se faça uma previsão é preciso q se tenha feito uma retificação de hora, n tenho este curso, e a retificação q fizeram, sinto n ser exata, qual o preço da previsão pelo skype? eu sou grata!
Ordália
======================
There seem to be a "correct combination" between the PHP CODE settings, and the server MySQL seetings in order to store and retrieve these characters properlu.
It seems (reading vague posts elsewhere) the correct settings for PHP would be to set a locale "pt_BR.utf-8" or "pt_BR.iso-8859-1", is it true?
This is incredible, I tried a lot of changes on the MySQL side (leaving PHP as UTF8 and AS Latin1 with no success:
Well. I tried changing MySQL collation to
utf8_bin
latin1_bin
latin1_general_ci
latin1_general_cs
and then to
latin1_swedish_ci (why not???)
It did not result in storing accented characters properly.
Any help on this matter would be more than welcomed since I'm lost.
Beto Boton
I need to get accented characters properly stored and retrieved via PHP on a MySQL Database.
The language is Brazilian Portuguese, but if I use French, for example, the great majority of this set is also present and the problem to set it up properly remains.
The PHP and MySQL Documentation is not of great help in this matter.
Here are the Accented Characters
ç Ç
á é í ó ú ü Á É Í Ó Ú Ü
à è ì ò ù À È Ì Ò Ù
ñ ã õ Ñ Ã Õ
â ê î ô û Â Ê Ô Û
Here is what I end up with in MySQL DB via PHP form
ç Ç
á é à ó ú à É à Ó Ú
à è ì ò ù À È Ì Ò Ù
ñ ã õ Ñ Ã Õ ü Ü
â ê î ô û Â Ê Ô Û não
Here is what more:
Users write a message using accented characters and it does not differ if using a Mac or a PC, if the characters are typed via localized keyboard or using a standard QWERTY and Alt Key to generate these caracters.
Here is the result using something provided in a software called Sequel Pro that encodes using (UTF8 via Latin1) The result is perfect!
Sei que p que se faça uma previsão é preciso q se tenha feito uma retificação de hora, n tenho este curso, e a retificação q fizeram, sinto n ser exata, qual o preço da previsão pelo skype? eu sou grata!
Ordália
Here is the result as Encoding UTF8 (the result is all scrambled as it is if seen by PHPMyAdmin
Sei que p que se faça uma previsão é preciso q se tenha feito uma retificação de hora, n tenho este curso, e a retificação q fizeram, sinto n ser exata, qual o preço da previsão pelo skype? eu sou grata!
Ordália
======================
There seem to be a "correct combination" between the PHP CODE settings, and the server MySQL seetings in order to store and retrieve these characters properlu.
It seems (reading vague posts elsewhere) the correct settings for PHP would be to set a locale "pt_BR.utf-8" or "pt_BR.iso-8859-1", is it true?
This is incredible, I tried a lot of changes on the MySQL side (leaving PHP as UTF8 and AS Latin1 with no success:
Well. I tried changing MySQL collation to
utf8_bin
latin1_bin
latin1_general_ci
latin1_general_cs
and then to
latin1_swedish_ci (why not???)
It did not result in storing accented characters properly.
Any help on this matter would be more than welcomed since I'm lost.
Beto Boton