Java Char to Unicode charToUnicodeLiteral(int value)

Here you can find the source of charToUnicodeLiteral(int value)

Description

char To Unicode Literal

License

GNU General Public License

Declaration

public static String charToUnicodeLiteral(int value) 

Method Source Code

//package com.java2s;
/*/*from   w  ww. j a  va2 s.c  o m*/
 *    Fernflower - The Analytical Java Decompiler
 *    http://www.reversed-java.com
 *
 *    (C) 2008 - 2010, Stiver
 *
 *    This software is NEITHER public domain NOR free software 
 *    as per GNU License. See license.txt for more details.
 *
 *    This software is distributed WITHOUT ANY WARRANTY; without 
 *    even the implied warranty of MERCHANTABILITY or FITNESS FOR 
 *    A PARTICULAR PURPOSE. 
 */

public class Main {
    public static String charToUnicodeLiteral(int value) {
        String sTemp = Integer.toHexString(value);
        sTemp = ("0000" + sTemp).substring(sTemp.length());
        return "\\u" + sTemp;
    }
}

Related

  1. charToUnicode(char c)
  2. charToUnicodeEscape(char c)
  3. charToUnicodeSequence(final StringBuilder buf, final char ch)
  4. charToUtf8(char ch, byte[] bytes, int start)
  5. toGreek(char c)