Documentation ¶
Overview ¶
Package gcharset 实现字符集转换功能。
支持的字符集:
中文: GBK/GB18030/GB2312/Big5 日语: EUCJP/ISO2022JP/ShiftJIS 韩语: EUCKR Unicode: UTF-8/UTF-16/UTF-16BE/UTF-16LE 其他: macintosh/IBM*/Windows*/ISO-*
Index ¶
- Constants
- Variables
- func Convert(dstCharset, srcCharset string, src string) (dst string, err error)
- func ConvertWithSizeLimit(dstCharset, srcCharset string, src string) (dst string, err error)
- func Supported(charset string) bool
- func ToUTF8(srcCharset string, src string) (dst string, err error)
- func UTF8To(dstCharset string, src string) (dst string, err error)
Constants ¶
View Source
const MaxInputSize = 10 * 1024 * 1024 // 10MB
MaxInputSize 定义了允许处理的最大输入大小(例如:10MB)
Variables ¶
View Source
var ErrUnsupportedCharset = errors.New("unsupported charset")
ErrUnsupportedCharset 表示不支持的字符集错误
Functions ¶
func ConvertWithSizeLimit ¶
ConvertWithSizeLimit 在进行转换之前检查输入大小,防止处理过大的输入
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.