encoding

package
v2.60.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeUTF16

func DecodeUTF16(b []byte) (string, error)

DecodeUTF16 get a slice of bytes and decode it to UTF-8

func EncodeUTF16

func EncodeUTF16(s string, addBOM bool) []byte

EncodeUTF16 get a utf8 string and translate it into a slice of bytes of ucs2

func IsUTF16

func IsUTF16(s []byte) bool

func UTF16Bom

func UTF16Bom(b []byte) int8

UTF16Bom returns 0 for no BOM, 1 for Big Endian and 2 for little endian it will return -1 if b is too small for having BOM

Types

This section is empty.

Jump to

Keyboard shortcuts

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