]> gitweb.factorcode.org Git - factor.git/blob - basis/io/encodings/iana/iana-docs.factor
d6ce4fb2fb5a96eef255fa2ea898fcf68f98cafd
[factor.git] / basis / io / encodings / iana / iana-docs.factor
1 USING: help.syntax help.markup strings ;
2 IN: io.encodings.iana
3
4 ABOUT: "io.encodings.iana"
5
6 ARTICLE: "io.encodings.iana" "IANA-registered encoding names"
7 "The " { $vocab-link "io.encodings.iana" } " vocabulary provides words for accessing the names of encodings and the encoding descriptors corresponding to names." $nl
8 "Most text encodings in common use have been registered with IANA. There is a standard set of names for each encoding. Simple conversion functions:" 
9 { $subsections
10     name>encoding
11     encoding>name
12 }
13 "To let a new encoding be used with the above words, use the following:"
14 { $subsections register-encoding } ;
15
16 HELP: name>encoding
17 { $values { "name" "an encoding name" } { "encoding" "an encoding descriptor" } }
18 { $description "Given an IANA-registered encoding name, find the encoding descriptor that represents it, or " { $snippet "f" } " if it is not found (either not implemented in Factor or not registered)." } ;
19
20 HELP: encoding>name
21 { $values { "encoding" "an encoding descriptor" } { "name" "an encoding name" } }
22 { $description "Given an encoding descriptor, return the preferred IANA name. If no name is found, returns " { $snippet "f" } "." } ;
23
24 { name>encoding encoding>name } related-words
25
26 HELP: register-encoding
27 { $values { "descriptor" "an encoding descriptor" } { "name" string } }
28 { $description "Registers an encoding descriptor with the given name, available for lookup through " { $link name>encoding } " and " { $link encoding>name } ". IANA-registered aliases are automatically included. The name given must be the first name in the " { $snippet "resources:basis/io/encodings/iana/character-sets" } " file." } ;