cesu8

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cesu8 implements functions and constants to support text encoded in CESU-8. It implements functions comparable to the unicode/utf8 package for UTF-8 de- and encoding.

Index

Constants

View Source
const (
	// CESUMax is the maximum amount of bytes used by an CESU-8 codepoint encoding.
	CESUMax = 6
)

Variables

This section is empty.

Functions

func DecodeRune

func DecodeRune(p []byte) (rune, int)

DecodeRune unpacks the first CESU-8 encoding in p and returns the rune and its width in bytes.

func EncodeRune

func EncodeRune(p []byte, r rune) int

EncodeRune writes into p (which must be large enough) the CESU-8 encoding of the rune. It returns the number of bytes written.

func FullRune

func FullRune(p []byte) bool

FullRune reports whether the bytes in p begin with a full CESU-8 encoding of a rune.

func RuneLen

func RuneLen(r rune) int

RuneLen returns the number of bytes required to encode the rune.

func Size

func Size(p []byte) int

Size returns the amount of bytes needed to encode an UTF-8 byte slice to CESU-8.

func StringSize

func StringSize(s string) int

StringSize is like Size with a string as parameter.

Types

This section is empty.

Jump to

Keyboard shortcuts

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