Here you can find the source of urlPercentEncodeTwo(char c)
public static char[] urlPercentEncodeTwo(char c)
//package com.java2s; //License from project: Apache License public class Main { public static final char[] HEX_TO_CHAR = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; public static final char PERCENT_SYMBOL = '%'; public static char[] urlPercentEncodeTwo(char c) { char[] result = null; int ci = c; int leftNibble = (0xF0 & ci) >> 4; int rightNibble = (0x0F & ci); result = new char[] { PERCENT_SYMBOL, HEX_TO_CHAR[leftNibble], HEX_TO_CHAR[rightNibble] }; return result; }/*from www. j a va2 s . c o m*/ }