java中GBK编码格式转成UTF8,用一段方法实现怎么做

2025-04-02 19:51:11
推荐回答(1个)
回答1:

//参考下面的:
String str = "hello";
String utfString = new String(str.getBytes("GBK"), "UTF-8");