Java tutorial
//package com.java2s; public class Main { private static int gbValue(char paramChar) { String str = new String() + paramChar; try { byte[] arrayOfByte = str.getBytes("GB2312"); if (arrayOfByte.length < 2) return 0; int i = 0xFF00 & arrayOfByte[0] << 8; int j = arrayOfByte[1]; return i + (j & 0xFF); } catch (Exception localException) { } return 0; } }