Welcome! Log In Create A New Profile

Advanced

Re: Setting Charset on Nginx PHP virtual host

Vincent M.
August 02, 2019 09:12AM
Hello Francis,

You are right, the charset map is missing and specified in the nginx log
error file:

/2019/08/02 12:53:42 [error] 19151#19151: *28013 no "charset_map"
between the charsets "UTF-8" and "iso-8859-1" while reading response
header from upstream, client: .../

I have found 3 charset maps in my nginx default install, but none for
iso-8859-1 to utf8 conversion:
koi-utf, koi-win, win-utf

So I tried in http with empty charset_map:
        charset_map iso-8859-1 utf-8 { }
But special characters like é are displayed with ?

Where to find a charset_map?

Thank you for your help,
Vincent.

Le 01/08/2019 à 22:07, Francis Daly a écrit :
> On Wed, Jul 31, 2019 at 05:29:37PM +0200, Vincent M. wrote:
>
> Hi there,
>
>> I have specified charset and overried_charset on both server and location
>> and yet, it was still sending headers in UTF-8.
> What does the error log say?
>
> Is there something like
>
> no "charset_map" between the charsets "utf-8" and "iso-8859-1" while reading response header from upstream
>
> there? Because that could explain why the conversion does not happen.
>
>> On Apache we can do:
>>
>> <VirtualHost mywebsite.com:80>
>> ...
>>     Header set Content-Type "text/html; charset=iso-8859-1"
>> </VirtualHost>
>>
>> How to do the same on Nginx?
> I think that that Apache config will set the Content-Type header
> on responses it sends; but will not do anything to actually make the
> response body be valid iso-8859-1.
>
> The nginx "charset" module expects to modify the response body if
> necessary.
>
> You can try adding a charset_map (http://nginx.org/r/charset_map) --
> either a full one that maps between the one-byte iso-8859-1 values and
> utf-8 values that differ; or just an empty one and let the &# conversion
> happen instead.
>
> charset_map iso-8859-1 utf-8 { }
>
> or include extra pieces like
>
> E9 C3A9 ; # LATIN SMALL LETTER E WITH ACUTE
>
> if you want explicit conversion.
>
> f


_______________________________________________
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: 129
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready