Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert these strange characters? (ë, Ã, ì, ù, Ã)

My page often shows things like ë, Ã, ì, ù, à in place of normal characters.

I use utf8 for header page and MySQL encode. How does this happen?

like image 509
Leonardo Avatar asked Feb 26 '11 15:02

Leonardo


People also ask

How do I change my UTF-8 character set?

Click Tools, then select Web options. Go to the Encoding tab. In the dropdown for Save this document as: choose Unicode (UTF-8). Click Ok.


2 Answers

These are utf-8 encoded characters. Use utf8_decode() to convert them to normal ISO-8859-1 characters.

like image 137
Ray Avatar answered Sep 21 '22 09:09

Ray


If you see those characters you probably just didn’t specify the character encoding properly. Because those characters are the result when an UTF-8 multi-byte string is interpreted with a single-byte encoding like ISO 8859-1 or Windows-1252.

In this case ë could be encoded with 0xC3 0xAB that represents the Unicode character ë (U+00EB) in UTF-8.

like image 35
Gumbo Avatar answered Sep 18 '22 09:09

Gumbo