mirror of
https://github.com/fumiama/go-base16384.git
synced 2026-06-23 12:40:32 +08:00
完成
This commit is contained in:
15
conv.go
Normal file
15
conv.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user