`

UnicodeHelper

    博客分类:
  • Java
 
阅读更多
public class UnicodeHelper  {
	
	public static String ConvertToUnicode(String sInput)
    {
    	String sResult = "";
        char[] oCharAry = new char[sInput.length()];
        for(int i=0; i<oCharAry.length; i++)
        {
        	oCharAry[i] = (char)sInput.charAt(i);
        	sResult+="\\u" + util.LeftPad(Integer.toString(oCharAry[i], 16), "0", 4);
        }
        return sResult;
    }
      
}

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics