Reputation: 11887
I'm having a weird problem regarding PHP and charset encoding..
I am developing a PHP Page that outputs some latin (ã, á, à, and so on) characters.
When I run the page from my localhost, it works just fine. However, when I upload it to my test-server and access it via a url, then all latin characters become little squares (in IE by the way).
I've changed the character encoding on my browser back and forth to utf8, western european and so on, but none seem to work
Does anybody have an idea?
Upvotes: 0
Views: 40
Reputation: 1108712
Either set the default_charset
in php.ini
to UTF-8
, or if you don't have the control over this, add the following line to the top of the PHP file, before you emit any character to the response body:
header('Content-Type: text/html;charset=UTF-8');
Upvotes: 1
Reputation: 9779
Have you checked for different default_charset
settings in the php.ini files of your localhost and your test server?
Upvotes: 1
Reputation: 8259
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> // Or actual encoding
</head>
Upvotes: 0