]> gitweb.factorcode.org Git - factor.git/blob - basis/io/encodings/iana/iana-docs.factor
628bceac6290e445b840a0c42748e07d7c641f67
[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 { $subsection name>encoding }
10 { $subsection encoding>name }
11 "To let a new encoding be used with the above words, use the following:"
12 { $subsection register-encoding } ;
13
14 HELP: name>encoding
15 { $values { "name" "an encoding name" } { "encoding" "an encoding descriptor" } }
16 { $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)." } ;
17
18 HELP: encoding>name
19 { $values { "encoding" "an encoding descriptor" } { "name" "an encoding name" } }
20 { $description "Given an encoding descriptor, return the preferred IANA name. If no name is found, returns " { $snippet "f" } "." } ;
21
22 { name>encoding encoding>name } related-words
23
24 HELP: register-encoding
25 { $values { "descriptor" "an encoding descriptor" } { "name" string } }
26 { $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." } ;