Here you can find the source of charToInt(char c)
public static int charToInt(char c)
//package com.java2s; //License from project: Open Source License public class Main { public static int charToInt(char c) { try {/* ww w . j a v a 2 s.co m*/ return Integer.parseInt("" + c); } catch (NumberFormatException e) { return Integer.decode("0x" + c); } } }