Unicode与汉语转换工具类

Unicode与中文转换工具类在上一家公司做Android注入时,如果注入中文会有问题,需要将中文转换为unicode码注

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]));     }

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