Java Unicode Unicode2ASCII(String unicode)

Here you can find the source of Unicode2ASCII(String unicode)

Description

Creates a new instance of ThaiUtil

License

Apache License

Declaration

public static String Unicode2ASCII(String unicode) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from w  w w .j a va2s  . co  m
     * Creates a new instance of ThaiUtil
     */
    public static String Unicode2ASCII(String unicode) {

        StringBuffer ascii = new StringBuffer(unicode);

        int code;

        for (int i = 0; i < unicode.length(); i++) {

            code = (int) unicode.charAt(i);

            if ((0xE01 <= code) && (code <= 0xE5B)) {
                ascii.setCharAt(i, (char) (code - 0xD60));
            }

        }

        return ascii.toString();

    }
}

Related

  1. unicode(String ipStr)
  2. unicode(String s)
  3. unicode(StringBuilder buf, char c)
  4. unicode2Byte(String s)
  5. Unicode2GBK(String dataStr)
  6. unicode2native(String s)
  7. unicodeChar(char a, char b, char c, char d)