Hi Everybody,
I am reading the Euro symbol (€) from a data stream I am parsing and inserting into a MySQL db. The problem is, whenever the symbol occurs, garbage is written into the field in the database. I presume I need to do a str_replace, but when i search for the € character, its not found.
I guess its encoded differently? How do I search for it and replace it with ‘€’ ?
as the preferred way to set the character encoding for a MySQL database connection. It should be used right after the establishment of the connection to the server but before the selecting of a database to work with.
Does this mysql query browser support utf-8?
Your “garbage” seems strange to me, because if utf-8 used on the whole data path, no recoding involved and any symbol must remain the same, no matter source encoding.
You already figured it out, but yes you need to convert into utf-8 manually. You don’t need the //TRANSLIT part since UTF-8 is capable of representing all the characters that exists in cp-1252.
Technically yes, but I would recommend doing the conversion in php, as livewire figured out hi self. The connection charset is a global setting, so by setting it to cp1252, you would have to make everything in the application use this charset.