Here you can find the source of toSBC(String s)
public static String toSBC(String s)
//package com.java2s; //License from project: Apache License public class Main { public static String toSBC(String s) { if (isEmpty(s)) return s; char[] chars = s.toCharArray(); for (int i = 0, len = chars.length; i < len; i++) { if (chars[i] == ' ') { chars[i] = (char) 12288; } else if (33 <= chars[i] && chars[i] <= 126) { chars[i] = (char) (chars[i] + 65248); } else { chars[i] = chars[i];//from w ww . j av a 2s . co m } } return new String(chars); } public static boolean isEmpty(CharSequence s) { return s == null || s.length() == 0; } public static int length(CharSequence s) { return s == null ? 0 : s.length(); } }