Welcome! Log In Create A New Profile

Advanced

Re: Setting Charset on Nginx PHP virtual host

Francis Daly
August 04, 2019 05:58PM
On Sun, Aug 04, 2019 at 03:11:36PM +0200, Vincent M. wrote:

Hi there,

> But the special characters was displayed with "?" not with � .

I wonder...

The nginx docs say """Missing characters in the range 80-FF are replaced
with “?”. """

Is there any chance that the response body is actually iso-8859-1,
but the header claims that it is utf-8? In that case, you would want to
change the header, but *not* convert the body.

(Strictly: you would want to fix the source, so that it does not lie
about its content. But if you can't do that, then "just" changing the
header in nginx may be adequate.)

> Anyway, it's a PHP issue not Nginx. The default PHP charset config is set to
> "utf-8" and to overwrite it, I have added on the beginning of my script:
>     ini_set('default_charset', 'iso-8859-1');
> And it's working fine...

Great that you have an overall configuration that works for you.

Cheers,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Setting Charset on Nginx PHP virtual host

Vincent M. July 31, 2019 11:30AM

Re: Setting Charset on Nginx PHP virtual host

Francis Daly August 01, 2019 04:08PM

Re: Setting Charset on Nginx PHP virtual host

Vincent M. August 02, 2019 09:12AM

Re: Setting Charset on Nginx PHP virtual host

Francis Daly August 02, 2019 11:06AM

Re: Setting Charset on Nginx PHP virtual host

Vincent M. August 04, 2019 09:12AM

Re: Setting Charset on Nginx PHP virtual host

Francis Daly August 04, 2019 05:58PM

Re: Setting Charset on Nginx PHP virtual host

Vincent M. August 05, 2019 08:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 280
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready