Java Unicode to String Unicode2Str(String s)

Here you can find the source of Unicode2Str(String s)

Description

Unicode Str

License

Apache License

Declaration

private static String Unicode2Str(String s) 

Method Source Code

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

public class Main {
    private static String Unicode2Str(String s) {
        int i = 0;
        int len = s.length();

        StringBuffer sb = new StringBuffer(len);
        while (i < len) {
            String t = s.substring(i, i + 4);
            char c = (char) Integer.parseInt(t, 16);
            i += 4;//from w  ww.  jav  a 2  s.c o m
            sb.append(c);
        }
        return sb.toString();
    }
}

Related

  1. unicode2String(String unicodeStr)
  2. unicodeStringToPrettyString(String s)
  3. unicodeToAscii(String name, StringBuffer result)
  4. unicodeToAscii(String theString)