Java tutorial
//package com.java2s; import java.io.*; public class Main { public static int stringSize(String s) { try { String anotherString = new String(s.getBytes("GBK"), "ISO8859_1"); return anotherString.length(); } catch (UnsupportedEncodingException ex) { ex.printStackTrace(); return 0; } } }