public static String toUTF8(String str){
		if(str == null){
			return null;
		}
		StringBuffer sb = new StringBuffer();
		for (int i=0; i< str.length(); i++) {
			char c = str.charAt(i);
			if(c >= 0 && c <= 256){
				sb.append(c);
			}
			else{
				try{
					byte[] b = Character.toString(c).getBytes("UTF-8");
					for (int j = 0; j < b.length; j++) {
						int k = b[j];
						if(k<0){
							k = k + 256;
						}
						sb.append("%" + Integer.toHexString(k).toUpperCase());
					}
				}
				catch (Exception e) {
					System.out.println(e);
				}
			}
		}
		
		return sb.toString();
	}