1
0
mirror of https://github.com/fumiama/go-base16384.git synced 2026-06-05 00:32:52 +08:00
Files
go-base16384/conv.go
fumiama c4a5495cbd 完成
2021-08-08 03:43:51 +08:00

16 lines
303 B
Go

package base14
import (
"golang.org/x/text/encoding/unicode"
)
var format = unicode.UTF16(unicode.BigEndian, unicode.IgnoreBOM)
func UTF16be2utf8(b []byte) ([]byte, error) {
return format.NewDecoder().Bytes(b)
}
func UTF82utf16be(b []byte) ([]byte, error) {
return format.NewEncoder().Bytes(b)
}