读书人

Unicode与汉语转换工具类

发布时间: 2012-09-24 13:49:41 作者: rapoo

Unicode与中文转换工具类

在上一家公司做Android注入时,如果注入中文会有问题,需要将中文转换为unicode码注入,在网上查了一下转换工具类,大多数都是如下的解决方案:

?

public static void main(String[] args){     String theString="中文汉字+123";     System.out.println(cstk.toUnicode(theString, false));     System.out.println(cstk.fromUnicode(theString.toCharArray(), 0, theString.length(), new char[1024]));     }

希望对看到的人有所帮助。

读书人网 >开源软件

热点推荐