mirror of
https://github.com/duke-git/lancet.git
synced 2026-03-01 00:35:28 +08:00
doc: add doc for Utf8ToGbk and GbkToUtf8
This commit is contained in:
1 parent
95af83b0cb
commit
be355a23f3
3 files changed
+154
-18
No files matched your search
@@ -379,7 +379,7 @@ func ToInterface(v reflect.Value) (value interface{}, ok bool) {
|
||||
}
|
||||
}
|
||||
|
||||
// Utf8ToGbk convert utf8 encoding to GBK encoding.
|
||||
// Utf8ToGbk convert utf8 encoding data to GBK encoding data.
|
||||
// Play: todo
|
||||
func Utf8ToGbk(bs []byte) ([]byte, error) {
|
||||
r := transform.NewReader(bytes.NewReader(bs), simplifiedchinese.GBK.NewEncoder())
|
||||
@@ -387,7 +387,7 @@ func Utf8ToGbk(bs []byte) ([]byte, error) {
|
||||
return b, err
|
||||
}
|
||||
|
||||
// GbkToUtf8 convert GBK encoding to utf8 encoding.
|
||||
// GbkToUtf8 convert GBK encoding data to utf8 encoding data.
|
||||
// Play: todo
|
||||
func GbkToUtf8(bs []byte) ([]byte, error) {
|
||||
r := transform.NewReader(bytes.NewReader(bs), simplifiedchinese.GBK.NewDecoder())
|
||||
|
||||
Reference in new issue
Block a user