Java String to Chinese GB2312 isGB2312(char c)

Here you can find the source of isGB2312(char c)

Description

is GB

License

Open Source License

Declaration

public static boolean isGB2312(char c) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static boolean isGB2312(char c) {
        Character ch = new Character(c);
        String sCh = ch.toString();
        try {//from   w w  w.  j a  v a  2 s .  c om
            byte[] bb = sCh.getBytes("gb2312");
            if (bb.length > 1) {
                return true;
            }
        } catch (java.io.UnsupportedEncodingException ex) {
            return false;
        }
        return false;
    }
}

Related

  1. toGB2312(String s)
  2. toGB2312(String s)
  3. toGb2312(String str)