charset

package
v0.19.4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const RuneError = utf8.RuneError

Variables

This section is empty.

Functions

func Collapse added in v0.18.0

func Collapse(dst []byte, src []rune, dstCharset Charset) []byte

func Convert

func Convert(dst []byte, dstCharset Charset, src []byte, srcCharset Charset) ([]byte, error)

Convert transforms `src`, encoded with Charset `srcCharset`, and changes its encoding so that it becomes encoded with `dstCharset`. The result is appended to `dst` if `dst` is not nil; otherwise a new byte slice will be allocated to store the result.

func ConvertFromBinary

func ConvertFromBinary(dst []byte, dstCharset Charset, src []byte) ([]byte, error)

func ConvertFromUTF8

func ConvertFromUTF8(dst []byte, dstCharset Charset, src []byte) ([]byte, error)

func Expand added in v0.18.0

func Expand(dst []rune, src []byte, srcCharset Charset) []rune

func IsBackslashSafe

func IsBackslashSafe(charset Charset) bool

func IsMultibyteByName

func IsMultibyteByName(csname string) bool

func IsUnicode

func IsUnicode(charset Charset) bool

func IsUnicodeByName

func IsUnicodeByName(csname string) bool

func Length

func Length(charset Charset, input []byte) int

func Slice

func Slice(charset Charset, input []byte, from, to int) []byte

func Validate

func Validate(charset Charset, input []byte) bool

Types

type Charset

type Charset = types.Charset

type Charset_8bit

type Charset_8bit = eightbit.Charset_8bit

type Charset_binary

type Charset_binary = eightbit.Charset_binary

type Charset_cp932

type Charset_cp932 = japanese.Charset_cp932

type Charset_eucjpms

type Charset_eucjpms = japanese.Charset_eucjpms

type Charset_euckr

type Charset_euckr = korean.Charset_euckr

type Charset_gb18030

type Charset_gb18030 = simplifiedchinese.Charset_gb18030

type Charset_gb2312

type Charset_gb2312 = simplifiedchinese.Charset_gb2312

type Charset_latin1

type Charset_latin1 = eightbit.Charset_latin1

type Charset_sjis

type Charset_sjis = japanese.Charset_sjis

type Charset_ucs2

type Charset_ucs2 = unicode.Charset_ucs2

type Charset_ujis

type Charset_ujis = japanese.Charset_ujis

type Charset_utf16

type Charset_utf16 = unicode.Charset_utf16be

type Charset_utf16le

type Charset_utf16le = unicode.Charset_utf16le

type Charset_utf32

type Charset_utf32 = unicode.Charset_utf32

type Charset_utf8mb3

type Charset_utf8mb3 = unicode.Charset_utf8mb3

type Charset_utf8mb4

type Charset_utf8mb4 = unicode.Charset_utf8mb4

type Convertible

type Convertible interface {
	Charset
	Convert(dst, src []byte, from Charset) ([]byte, error)
}

type UnicodeMapping

type UnicodeMapping = eightbit.UnicodeMapping

Directories

Path Synopsis
Package korean provides Korean encodings such as EUC-KR.
Package korean provides Korean encodings such as EUC-KR.
Package simplifiedchinese provides Simplified Chinese encodings such as GBK.
Package simplifiedchinese provides Simplified Chinese encodings such as GBK.

Jump to

Keyboard shortcuts

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