Java Unicode Escape unicodeEscape(char c)

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

Description

unicode Escape

License

Open Source License

Declaration

private static String unicodeEscape(char c) 

Method Source Code

//package com.java2s;

public class Main {
    private static String unicodeEscape(char c) {
        if (c <= 0xf)
            return "\\u000" + Integer.toHexString(c);
        else if (c <= 0xff)
            return "\\u00" + Integer.toHexString(c);
        else if (c <= 0xfff)
            return "\\u0" + Integer.toHexString(c);
        else/*  www . j  a  v a  2s .c  om*/
            return "\\u" + Integer.toHexString(c);
    }
}

Related

  1. unicodeEscape(Character ch)
  2. unicodeEscape(String s)
  3. unicodeEscape(String s)
  4. unicodeEscape(StringBuilder result, int in, int index)