Mercurial > hg > nginx-ranges
annotate contrib/unicode2nginx/unicode-to-nginx.pl @ 397:05981f639d21 NGINX_0_7_9
nginx 0.7.9
*) Change: now ngx_http_charset_module works by default with following
MIME types: text/html, text/css, text/xml, text/plain,
text/vnd.wap.wml, application/x-javascript, and application/rss+xml.
*) Feature: the "charset_types" and "addition_types" directives.
*) Feature: now the "gzip_types", "ssi_types", and "sub_filter_types"
directives use hash.
*) Feature: the ngx_cpp_test_module.
*) Feature: the "expires" directive supports daily time.
*) Feature: the ngx_http_xslt_module improvements and bug fixing.
Thanks to Denis F. Latypoff and Maxim Dounin.
*) Bugfix: the "log_not_found" directive did not work for index files
tests.
*) Bugfix: HTTPS connections might hang, if kqueue, epoll, rtsig, or
eventport methods were used; the bug had appeared in 0.7.7.
*) Bugfix: if the "server_name", "valid_referers", and "map" directives
used an "*.domain.tld" wildcard and exact name "domain.tld" was not
set, then the exact name was matched by the wildcard; the bugs had
appeared in 0.3.18.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 12 Aug 2008 00:00:00 +0400 |
parents | fa32d59d9a15 |
children |
rev | line source |
---|---|
216 | 1 #!/usr/bin/perl -w |
2 | |
3 # Convert unicode mappings to nginx configuration file format. | |
4 | |
5 # You may find useful mappings in various places, including | |
6 # unicode.org official site: | |
7 # | |
8 # http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT | |
9 # http://www.unicode.org/Public/MAPPINGS/VENDORS/MISC/KOI8-R.TXT | |
10 | |
11 # Needs perl 5.6 or later. | |
12 | |
13 # Written by Maxim Dounin, mdounin@rambler-co.ru | |
14 | |
15 ############################################################################### | |
16 | |
17 require 5.006; | |
18 | |
19 while (<>) { | |
20 # Skip comments and empty lines | |
21 | |
22 next if /^#/; | |
23 next if /^\s*$/; | |
24 chomp; | |
25 | |
26 # Convert mappings | |
27 | |
28 if (/^\s*0x(..)\s*0x(....)\s*(#.*)/) { | |
29 # Mapping <from-code> <unicode-code> "#" <unicode-name> | |
30 my $cs_code = $1; | |
31 my $un_code = $2; | |
32 my $un_name = $3; | |
33 | |
34 # Produce UTF-8 sequence from character code; | |
35 | |
36 my $un_utf8 = join('', map { sprintf("%02X", $_) } unpack("C*", pack("U", hex($un_code)))); | |
37 | |
38 print " $cs_code $un_utf8 ; $un_name\n"; | |
39 | |
40 } else { | |
41 warn "Unrecognized line: '$_'"; | |
42 } | |
43 } | |
44 | |
45 ############################################################################### |