Charsets

We are sure: existence of various charsets gives you as much pleasure as it does to us.

Parser has a built-in capability of transcoding documents from charset used on server into that used by visitor and back. Parser transcodes:
·form data;  
·strings (before transformation of type uri);  
·text resulting from page processing.  

You specify charset used in documents on server in field
$request:charset.
You specify charset to be used in output in field
$response:charset.
You should do it in one of
auto methods.

We recommend you to specify result charset in HTTP-header
content-type, so that a browser knew about it and a visitor did not have to select charsets manually.
$response:content-type[
   $.value[text/html]
   $.charset[$response:charset]
]

Charsets to be used in email messages can be specified as different from that of the output, see
^mail:send[…].

While working with databases, you should specify connection settings in such a way that SQL query and response data were in charset given in
$request:charset, see Format of connect string.


A list of allowable charsets is defined in Configuration file.
Default charset for all documents is
UTF-8.

Note: when transcoding from UTF-8 if some character is not specified in transcode table, a sequence
&#DDDD; is inserted instead. DDDD is decimal Unicode of that character.

Note: when transcoding to UTF-8 if some character is not specified in transcode table, a sequence
%HH is inserted instead. HH is hexadecimal code of that character. [3.1.4]

Note: charset's name is case insensitive.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 06.08.2004