# HG changeset patch # User Ruslan Ermilov # Date 1327400125 0 # Node ID 55c1c4a1748f02ce66c7d43e6ce67c6ca20c73cf # Parent 302222923e344675fd55c9de5fbde8e1dd6a4974 English translation of ngx_http_charset_module. diff -r 302222923e34 -r 55c1c4a1748f xml/en/GNUmakefile --- a/xml/en/GNUmakefile Tue Jan 24 10:13:26 2012 +0000 +++ b/xml/en/GNUmakefile Tue Jan 24 10:15:25 2012 +0000 @@ -49,6 +49,7 @@ http/ngx_http_auth_basic_module \ http/ngx_http_autoindex_module \ http/ngx_http_browser_module \ + http/ngx_http_charset_module \ http/ngx_http_empty_gif_module \ http/ngx_http_fastcgi_module \ http/ngx_http_flv_module \ diff -r 302222923e34 -r 55c1c4a1748f xml/en/docs/http/ngx_http_charset_module.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xml/en/docs/http/ngx_http_charset_module.xml Tue Jan 24 10:15:25 2012 +0000 @@ -0,0 +1,208 @@ + + + + + + +
+ + +The ngx_http_charset_module module adds the specified +charset to the
Content-Type
response header field. +In addition, the module can convert data from one charset to another, +with some limitations: + + + +conversion is performed one way — from server to client, + + + +only single-byte charsets can be converted + + + +or single-byte charsets to/from UTF-8. + + + +
+ +
+ + +
+ + + + include conf/koi-win; + + charset windows-1251; + source_charset koi8-r; + + + +
+ + +
+ + +charset | off +off +http +server +location +if in location + + +Adds the specified charset to the
Content-Type
+response header field. +If this charset is different from the charset specified +in the directive, a conversion is performed. +
+ + +The parameter off cancels the addition of charset +to the
Content-Type
response header field. +
+ + +A charset can be defined with a variable: + +charset $charset; + +In such a case, all possible values of a variable need to be present +in the configuration at least once in the form of the +, , or + directives. +For utf-8, windows-1251, and +koi8-r charsets it is sufficient to include the files +conf/koi-win, conf/koi-utf, and +conf/win-utf into configuration. +For other charsets, simply making a fictitious conversion table works, +for example: + +charset_map iso-8859-5 _ { } + + + +
+ + + +charset1 charset2 + +http + + +Describes the conversion table from one charset to another. +A reverse conversion table is built using the same data. +Character codes are given in hexadecimal. +Missing characters in the range 80-FF are replaced with “?”. +When converting from UTF-8, characters missing in a one-byte charset +are replaced with “&#XXXX;”. + + + +Example: + +charset_map koi8-r windows-1251 { + C0 FE ; # small yu + C1 E0 ; # small a + C2 E1 ; # small b + C3 F6 ; # small ts + ... +} + + + + +When describing a conversion table to UTF-8, codes for the UTF-8 charset should +be given in the second column, for example: + +charset_map koi8-r utf-8 { + C0 D18E ; # small yu + C1 D0B0 ; # small a + C2 D0B1 ; # small b + C3 D186 ; # small ts + ... +} + + + + +Full conversion tables from koi8-r to +windows-1251, and from koi8-r and +windows-1251 to utf-8 +are provided in the distribution files conf/koi-win, +conf/koi-utf, and conf/win-utf. + + + + + + +mime-type ... +text/html text/xml text/plain text/vnd.wap.wml +application/x-javascript application/rss+xml +http +server +location +0.7.9 + + +Enables module processing in responses with the specified MIME types +in addition to “text/html”. + + + + + + +on | off +off +http +server +location +if in location + + +Determines if a conversion should be performed for answers +received from a proxied or FastCGI server, +if the answers already carry a charset in the
Content-Type
+response header field. +If conversion is enabled, a charset specified in the received +response is used as a source charset. + +It should be noted that if a response was received in a subrequest +then conversion from the response charset to the main request charset +is always performed regardless of the override_charset +directive setting. + +
+ +
+ + + +charset + +http +server +location +if in location + + +Defines the source charset of a response. +If this charset is different from the charset specified +in the directive, a conversion is performed. + + + + +
+ +
diff -r 302222923e34 -r 55c1c4a1748f xml/en/docs/index.xml --- a/xml/en/docs/index.xml Tue Jan 24 10:13:26 2012 +0000 +++ b/xml/en/docs/index.xml Tue Jan 24 10:15:25 2012 +0000 @@ -95,6 +95,11 @@ + +ngx_http_charset_module + + + ngx_http_empty_gif_module