Nginx Module Reference manual: Character Set Setup module (Charset)

Source: Internet
Author: User
Keywords Nginx charset Character set module
Tags client code compiled configuration configuration instance configure content data

These modules are all compiled into Nginx by default unless a module is manually specified to be excluded in configure.

This module adds a character encoding to the Content-type field in the answer header.
In addition, this module can encode the data and can only be encoded in one way, that is, from the server to the client.
Configuration instance:

CharSet Windows-1251;source_charset Koi8-r;

Instructions

CharSet

Syntax: CharSet Encoding|off
Default value: CharSet off
Using fields: HTTP, server, location, location if field
This directive causes the "Content-type" field in the answer header to use the specified encoding set, and if the character set is not the same as the set of the source_charset instruction, the character set is encoded, and the argument off indicates that "Content-type" information is not added to the answer header.

Charset_map

Syntax: Charset_map encoding1 encoding2 {...}
Default value: No
Working with fields: HTTP, server, location
CHARSET_MAP specifies an encoding conversion table and creates a reverse conversion table with the code in hexadecimal, and if there is no code recorded in the 80-FF scope, they are marked as "? ”。
The following example:

Charset_map koi8-r windows-1251 {C0 FE; # Sgt Yu C1 E0; # Sgt A C2 E1; # Sgt B C3 F6; # Sgt ts # ...}

Convert Koi8-r to Windows-1251 's full conversion table as Conf/koi-win.

Override_charset

Syntax: Override_charset on|off
Default value: Override_charset off
Using fields: HTTP, server, location, location fields in if
parameter specifies that the "Content-type" field exists in the answer header obtained on the proxy server or on the FASTCGI server, and the encoding conversion is enabled for the answer, and if encoding conversion is allowed, it is initialized with the encoding specified in the answer header.
Note If an answer is taken in a subquery, the encoding in the answer is always converted to the underlying encoding, not dependent on the override_charset instruction.

Source_charset

Syntax: Source_charset encoding
Default value: No
Using fields: HTTP, server, location, location fields in if
parameter specifies the initial code in the answer, and if this parameter is different from the CharSet directive, the encoding conversion is enabled.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.