Path: blob/main/vendor/golang.org/x/text/encoding/htmlindex/map.go
2893 views
// Copyright 2015 The Go Authors. All rights reserved.1// Use of this source code is governed by a BSD-style2// license that can be found in the LICENSE file.34package htmlindex56import (7"golang.org/x/text/encoding"8"golang.org/x/text/encoding/charmap"9"golang.org/x/text/encoding/internal/identifier"10"golang.org/x/text/encoding/japanese"11"golang.org/x/text/encoding/korean"12"golang.org/x/text/encoding/simplifiedchinese"13"golang.org/x/text/encoding/traditionalchinese"14"golang.org/x/text/encoding/unicode"15)1617// mibMap maps a MIB identifier to an htmlEncoding index.18var mibMap = map[identifier.MIB]htmlEncoding{19identifier.UTF8: utf8,20identifier.UTF16BE: utf16be,21identifier.UTF16LE: utf16le,22identifier.IBM866: ibm866,23identifier.ISOLatin2: iso8859_2,24identifier.ISOLatin3: iso8859_3,25identifier.ISOLatin4: iso8859_4,26identifier.ISOLatinCyrillic: iso8859_5,27identifier.ISOLatinArabic: iso8859_6,28identifier.ISOLatinGreek: iso8859_7,29identifier.ISOLatinHebrew: iso8859_8,30identifier.ISO88598I: iso8859_8I,31identifier.ISOLatin6: iso8859_10,32identifier.ISO885913: iso8859_13,33identifier.ISO885914: iso8859_14,34identifier.ISO885915: iso8859_15,35identifier.ISO885916: iso8859_16,36identifier.KOI8R: koi8r,37identifier.KOI8U: koi8u,38identifier.Macintosh: macintosh,39identifier.MacintoshCyrillic: macintoshCyrillic,40identifier.Windows874: windows874,41identifier.Windows1250: windows1250,42identifier.Windows1251: windows1251,43identifier.Windows1252: windows1252,44identifier.Windows1253: windows1253,45identifier.Windows1254: windows1254,46identifier.Windows1255: windows1255,47identifier.Windows1256: windows1256,48identifier.Windows1257: windows1257,49identifier.Windows1258: windows1258,50identifier.XUserDefined: xUserDefined,51identifier.GBK: gbk,52identifier.GB18030: gb18030,53identifier.Big5: big5,54identifier.EUCPkdFmtJapanese: eucjp,55identifier.ISO2022JP: iso2022jp,56identifier.ShiftJIS: shiftJIS,57identifier.EUCKR: euckr,58identifier.Replacement: replacement,59}6061// encodings maps the internal htmlEncoding to an Encoding.62// TODO: consider using a reusable index in encoding/internal.63var encodings = [numEncodings]encoding.Encoding{64utf8: unicode.UTF8,65ibm866: charmap.CodePage866,66iso8859_2: charmap.ISO8859_2,67iso8859_3: charmap.ISO8859_3,68iso8859_4: charmap.ISO8859_4,69iso8859_5: charmap.ISO8859_5,70iso8859_6: charmap.ISO8859_6,71iso8859_7: charmap.ISO8859_7,72iso8859_8: charmap.ISO8859_8,73iso8859_8I: charmap.ISO8859_8I,74iso8859_10: charmap.ISO8859_10,75iso8859_13: charmap.ISO8859_13,76iso8859_14: charmap.ISO8859_14,77iso8859_15: charmap.ISO8859_15,78iso8859_16: charmap.ISO8859_16,79koi8r: charmap.KOI8R,80koi8u: charmap.KOI8U,81macintosh: charmap.Macintosh,82windows874: charmap.Windows874,83windows1250: charmap.Windows1250,84windows1251: charmap.Windows1251,85windows1252: charmap.Windows1252,86windows1253: charmap.Windows1253,87windows1254: charmap.Windows1254,88windows1255: charmap.Windows1255,89windows1256: charmap.Windows1256,90windows1257: charmap.Windows1257,91windows1258: charmap.Windows1258,92macintoshCyrillic: charmap.MacintoshCyrillic,93gbk: simplifiedchinese.GBK,94gb18030: simplifiedchinese.GB18030,95big5: traditionalchinese.Big5,96eucjp: japanese.EUCJP,97iso2022jp: japanese.ISO2022JP,98shiftJIS: japanese.ShiftJIS,99euckr: korean.EUCKR,100replacement: encoding.Replacement,101utf16be: unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM),102utf16le: unicode.UTF16(unicode.LittleEndian, unicode.IgnoreBOM),103xUserDefined: charmap.XUserDefined,104}105106107