0

All things being equal, i.e. same code base, same LAMP setup (identical versions too), what server side settings affect charset encoding? I have a problem where the euro sign is displaying correctly locally (€) and incorrectly (as â�¬) on a remote server. I've checked the response headers both locally and remotely and they both return 'Content-Type text/html; charset=UTF-8' and as they are both using the exact same code base they also both have the relevant 'content="text/html; charset=UTF-8"' meta and php header() calls. I'm presuming it's possible an httpd or php.ini setting somewhere but I'm struggling to see it?

Thanks in advance.

  • Versions of software might be useful to know in this case – RiggsFolly Aug 21 '17 at 08:05
  • Some of the weird PHP mb extension auto output conversion settings perhaps? First confirm what encoding the page is actually in; e.g. use your browser's View → Encoding settings to override the header and see what encoding it looks okay in, or use a hex editor to see the raw bytes. – deceze Aug 21 '17 at 08:08
  • Here's the versions if it helps: Apache 2.4.18, PHP 5.6.29, MySQL 5.6.34. In the browser (View -> Encoding) it shows as Unicode and none of the overrides shows it correctly. –  Aug 21 '17 at 08:12
  • This is likely to be a [UTF-8 all the way through issue](https://stackoverflow.com/questions/279170/utf-8-all-the-way-through) so read this – RiggsFolly Aug 21 '17 at 08:17

1 Answers1

1

Thanks to all, reading 'UTF-8 all the way through' was useful and helped. I found in my particular case that my php.ini on the remote server had default_charset = "iso-8859-1" in it and it appeared to be falling back to this despite all the UTF-8 headers in the code, changing this to default_charset = "UTF-8" has resolved the problem.