编码字符集类

package
v0.0.0-...-2910145 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 9 Imported by: 0

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-* 这段注释描述了一个名为 `gcharset` 的 Go 语言包,它实现了字符集转换功能,并列出了该包支持的多种字符集,包括中文、日文、韩文对应的常见编码以及 Unicode 和其他一些通用或特定平台的字符集。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Convert

func Convert(dstCharset string, srcCharset string, src string) (dst string, err error)

Convert 将 `src` 字符串从 `srcCharset` 编码转换为 `dstCharset` 编码, 并返回转换后的字符串。 如果转换失败,则直接返回原字符串 `src` 作为结果。

func Supported

func Supported(charset string) bool

Supported 返回 `charset` 字符集是否被支持。

func ToUTF8

func ToUTF8(srcCharset string, src string) (dst string, err error)

ToUTF8 将 `src` 字符集从 `srcCharset` 转换为 UTF-8, 并返回转换后的字符串。

func UTF8To

func UTF8To(dstCharset string, src string) (dst string, err error)

UTF8To将`src`的字符集编码从UTF-8转换为`dstCharset`, 并返回转换后的字符串。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL