Italian character madness

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Italian character madness

Post by klevis miho »

When I do this:
echo 'à';

it prints:
Ã

How can I avoid this?
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Italian character madness

Post by McInfo »

What character set is your file encoded in? Does the server send the appropriate Content-Type header?

For example, if the page is encoded in UTF-8, the server should send this Content-Type header:

Code: Select all

Content-Type: text/html; charset=UTF-8
If the file is encoded in UTF-8 and the browser thinks it is ISO-8859-1, "à" will look like "Ã".
Post Reply