package ianaindex
Import Path
golang.org/x/text/encoding/ianaindex (on go.dev)
Dependency Relation
imports 15 packages, and imported by one package
Involved Source Files
ascii.go
Package ianaindex maps names to Encodings as specified by the IANA registry.
This includes both the MIME and IANA names.
See http://www.iana.org/assignments/character-sets/character-sets.xhtml for
more details.
tables.go
Code Examples
package main
import (
"fmt"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/encoding/ianaindex"
)
func main() {
fmt.Println(ianaindex.MIME.Name(charmap.ISO8859_7))
fmt.Println(ianaindex.IANA.Name(charmap.ISO8859_7))
fmt.Println(ianaindex.MIB.Name(charmap.ISO8859_7))
e, _ := ianaindex.IANA.Encoding("cp437")
fmt.Println(ianaindex.IANA.Name(e))
}
Package-Level Type Names (only one)
Index maps names registered by IANA to Encodings.
Currently different Indexes only differ in the names they return for
encodings. In the future they may also differ in supported aliases.
Encoding returns an Encoding for IANA-registered names. Matching is
case-insensitive.
If the provided name doesn't match a IANA-registered charset, an error is
returned. If the name matches a IANA-registered charset but isn't supported,
a nil encoding and a nil error are returned.
Name reports the canonical name of the given Encoding. It will return an
error if the e is not associated with a known encoding scheme.
var IANA *Index
var MIB *Index
var MIME *Index
Package-Level Variables (total 3)
IANA is an index that supports all names and aliases using IANA names as
the canonical identifier.
MIB is an index that associates the MIB display name with an Encoding.
MIME is an index to map MIME names.
![]() |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |