如何将ANSI文本转换为UTF8 [英] How to convert ansi text to utf8

查看:1106
本文介绍了如何将ANSI文本转换为UTF8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Go中将ANSI文本转换为utf8? 我正在尝试将ansi字符串转换为utf8字符串.

How to convert ansi text to utf8 in Go? I am trying to convert ansi string to utf8 string.

推荐答案

Go仅具有UTF-8字符串.您可以使用此处描述的从byte []进行的转换将某些内容转换为UTF8字符串:

Go only has UTF-8 strings. You can convert something to a UTF8 string using the conversion described here from a byte[]:

http://golang.org/doc/go_spec.html#Conversions

这篇关于如何将ANSI文本转换为UTF8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆