gf: github.com/gogf/gf/encoding/gcharset Index | Files

package gcharset

import "github.com/gogf/gf/encoding/gcharset"

Package charset implements character-set conversion functionality.

Supported Character Set:

Chinese : GBK/GB18030/GB2312/Big5

Japanese: EUCJP/ISO2022JP/ShiftJIS

Korean : EUCKR

Unicode : UTF-8/UTF-16/UTF-16BE/UTF-16LE

Other : macintosh/IBM*/Windows*/ISO-*

Index

Package Files

gcharset.go

func Convert Uses

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

Convert converts <src> charset encoding from <srcCharset> to <dstCharset>, and returns the converted string. It returns <src> as <dst> if it fails converting.

func Supported Uses

func Supported(charset string) bool

Supported returns whether charset <charset> is supported.

func ToUTF8 Uses

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

ToUTF8 converts <src> charset encoding from <srcCharset> to UTF-8 , and returns the converted string.

func UTF8To Uses

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

UTF8To converts <src> charset encoding from UTF-8 to <dstCharset>, and returns the converted string.

Package gcharset imports 7 packages (graph) and is imported by 2 packages. Updated 2019-12-04. Refresh now. Tools for package owners.