int (char ch) { // Simple binary search for the correct character. int low = 0; int hi = upperSpecial.length - 2; int mid = ((low + hi) >> 2) << 1; char c = upperSpecial[mid]; while (ch != c) { if (ch < c) hi = mid - 2; else low = mid + 2; mid = ((low + hi) >> 2) << 1; c = upperSpecial[mid]; } return upperSpecial[mid + 1]; }