Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Does Nginx really include charset maps

$
0
0
I'm using Linux Debian WheezY with PHP 5.5.1 and Nginx 1.6.2 and search for a solution to open files with german umlauts as, for example, "vögel.jpg" or files in directories with german umlauts, but it appears only the error 404 Not Found nginx/1.6.2.

If I type v%f6gel.jpg with f6 (ö ISO-8859-1 and ascii) instead of vögel.jpg it works and the file is shown in the Browserwindow.

If I type v%C3%B6gel.jpg with %C3%B6 (ö UTF-8) instead of vögel.jpg the filename jumps back in the url field to vögel.jpg and nothing is shown.

My Nginx settings are:
charset utf-8;
source_charset utf-8;
override_charset on;

charset and source_charset are determined according to the Nginx homepage to add the charset utf-8 to the “Content-Type” response header, however, I don't know if for jpg files is used a response header. If is used ascii or ISO-8859-1 or other charsets instead of utf-8 nothing changes.

Also if are included the nginx charset maps nothing changes:
include koi-utf;
include koi-win;
include win-utf;

Just so this seemingly not takes affect:
source_charset ascii;
charset utf-8;
override_charset on;
charset_map ascii utf-8 {
f6 c3b6;
}

or

charset_map iso-8859-1 utf-8 {
f6 c3b6;
}

or

charset_map utf-8 ascii {
c3b6 f6;
}
nginx error: invalid value "c3b6"

or

charset_map utf-8 iso-8859-1 {
c3b6 f6;
}
nginx error: invalid value "c3b6"


According to PHP with echo mb_detect_encoding($filename); the jpg file encoding is ascii, but if I change the file encoding to utf-8, the jpg files can't be opened in the browser and look like this: vögel.jpg

Everything stays always the same even without charset. Thus my question: Does Nginx really include charset maps and if yes, how must this happen so that files with umlauts can be opened in the browser.
Many thanks

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>