Java Unicode to String unicodeToString(String hex)

Here you can find the source of unicodeToString(String hex)

Description

unicode To String

License

Apache License

Declaration

public static String unicodeToString(String hex) 

Method Source Code

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

public class Main {
    public static String unicodeToString(String hex) {
        int t = hex.length() / 6;
        int iTmp = 0;
        StringBuilder str = new StringBuilder();
        for (int i = 0; i < t; i++) {
            String s = hex.substring(i * 6, (i + 1) * 6);

            iTmp = Integer.valueOf(s.substring(2, 4), 16).intValue() << 8
                    | Integer.valueOf(s.substring(4), 16).intValue();

            str.append(new String(Character.toChars(iTmp)));
        }// w ww  .ja  va2  s  . c om
        return str.toString();
    }
}

Related

  1. unicodeStringToPrettyString(String s)
  2. unicodeToAscii(String name, StringBuffer result)
  3. unicodeToAscii(String theString)
  4. unicodeToString(int unicode)
  5. unicodeToString(String escaped)
  6. unicodeToString(String unicodeStr)