This is a creation in Article, where the information may have evolved or changed.
This intended to use iconv-go, but after compiling a lot of problems, still can't find cannot find-liconv, because of the time problem temporarily instead of Mahonia.
Download the Mahonia code, put it at an address, and then refer to that address (details are free to fill);
Then the following
Converts a byte array to a specified character set:
The key statements are as follows
D: = Newdecoder (target character set name) str: = D.convertstring (string to convert)
The whole content.
Cond...
Converts a character set byte array to a specified character set string:
Key statement
Func converttostring (src string, srccode string, Tagcode String) string {srccoder: = Mahonia. Newdecoder (srccode) Srcresult: = srccoder.convertstring (src) tagcoder: = Mahonia. Newdecoder (Tagcode) _, CDATA, _: = Tagcoder.translate ([]byte (Srcresult), true) Result: = String (CDATA) return Res Ult
Here is the full content:
Cond...