<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">
<div class="moz-cite-prefix">Hello Francis,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">You are right, the charset map is
missing and specified in the nginx log error file:</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><i>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></div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">I have found 3 charset maps in my
nginx default install, but none for iso-8859-1 to utf8
conversion:</div>
<div class="moz-cite-prefix">koi-utf, koi-win, win-utf <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">So I tried in http with empty
charset_map:</div>
<div class="moz-cite-prefix"> charset_map iso-8859-1 utf-8
{ }</div>
<div class="moz-cite-prefix">But special characters like é are
displayed with ?</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Where to find a charset_map?<br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Thank you for your help,</div>
<div class="moz-cite-prefix">Vincent.</div>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Le 01/08/2019 à 22:07, Francis Daly a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:20190801200707.vmbtbqhojlpqeiz2@daoine.org">
<pre class="moz-quote-pre" wrap="">On Wed, Jul 31, 2019 at 05:29:37PM +0200, Vincent M. wrote:
Hi there,
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">I have specified charset and overried_charset on both server and location
and yet, it was still sending headers in UTF-8.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
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.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">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?
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
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 (<a class="moz-txt-link-freetext" href="http://nginx.org/r/charset_map">http://nginx.org/r/charset_map</a>) --
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
</pre>
</blockquote>
<p><br>
</p>
</body>
</html>