1 USING: help.syntax help.markup strings ;
4 ABOUT: "io.encodings.iana"
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 } ;
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)." } ;
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" } "." } ;
22 { name>encoding encoding>name } related-words
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." } ;