WAP PUSH后台源码,WAP PUSH后台源码
源代码在线查看: font.java
package com.sxit.wap.common;
public class Font {
public Font() {
}
public static String getJavaUTFString(String gbString) {
if (gbString == null) {
return "";
}
char[] utfBytes = gbString.toCharArray();
String unicodeBytes = "";
for (int byteIndex = 0; byteIndex < utfBytes.length; byteIndex++) {
String hexB = "";
if (utfBytes[byteIndex] > '!') {
hexB = Integer.toHexString(utfBytes[byteIndex]);
if (hexB.length() hexB = "00" + hexB;
}
unicodeBytes = unicodeBytes + "" + hexB + ";";
}
else {
unicodeBytes += utfBytes[byteIndex];
}
}
return unicodeBytes;
}
public static void main(String[] args){
System.out.println(Font.getJavaUTFString("你好"));
}
}