Question

I am adding spanish as a language and I'm having problems with the encoding.

All the spanish characters work perfectly locally (this makes it harder to debug):

enter image description here

But on the server they look this way:

enter image description here

I'm pretty puzzled, you can see the beta version here.

My doctype and charset are the following:

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
...

Which should be correct as far as I understand.

I am using gettext for translations.

I checked and the declared encoding of the .po file is UTF-8.

I also set bind_textdomain_codeset to UTF-8.

I'm not sure where the problem is actually relying.

Was it helpful?

Solution

Your server is set to serve pages with this Content-Type header:

Content-Type:text/html; charset=iso-8859-1

You need to tell it to serve them as charset=utf-8 instead. You can do this in PHP too:

header('Content-Type: text/html; charset=utf-8');
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top