encoding

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const MB_ERR_INVALID_CHARS = 8

Code generated by go-importconst DO NOT EDIT.

Variables

This section is empty.

Functions

func IsDBCSLeadByte

func IsDBCSLeadByte(b byte) bool

func ToWideChar

func ToWideChar(bytes ...byte) ([]uint16, error)

Types

type DBCSEncoding

type DBCSEncoding struct{}

func (DBCSEncoding) Count

func (DBCSEncoding) Count(value byte, _ int64) int

func (DBCSEncoding) Decode

func (DBCSEncoding) Decode(data []byte) rune

func (DBCSEncoding) EncodeFromString

func (DBCSEncoding) EncodeFromString(s string) ([]byte, error)

func (DBCSEncoding) ModeString

func (DBCSEncoding) ModeString() string

func (DBCSEncoding) RuneOver

func (DBCSEncoding) RuneOver(cursor Pointer) (rune, int, int)

type Encoding

type Encoding interface {
	Count(value byte, at int64) int
	Decode([]byte) rune
	RuneOver(Pointer) (rune, int, int)
	ModeString() string
	EncodeFromString(string) ([]byte, error)
}

func UTF16BE

func UTF16BE() Encoding

func UTF16LE

func UTF16LE() Encoding

type Pointer

type Pointer interface {
	Value() byte
	Next() error
	Prev() error
	Address() int64
}

type UTF8Encoding

type UTF8Encoding struct{}

func (UTF8Encoding) Count

func (UTF8Encoding) Count(b byte, _ int64) int

func (UTF8Encoding) Decode

func (UTF8Encoding) Decode(data []byte) rune

func (UTF8Encoding) EncodeFromString

func (UTF8Encoding) EncodeFromString(s string) ([]byte, error)

func (UTF8Encoding) ModeString

func (UTF8Encoding) ModeString() string

func (UTF8Encoding) RuneOver

func (enc UTF8Encoding) RuneOver(cursor Pointer) (rune, int, int)

Jump to

Keyboard shortcuts

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