Java Unicode Create getUnicodeText(Object text)

Here you can find the source of getUnicodeText(Object text)

Description

get Unicode Text

License

Open Source License

Declaration

public static String getUnicodeText(Object text)
            throws UnsupportedEncodingException 

Method Source Code

//package com.java2s;

import java.io.UnsupportedEncodingException;

public class Main {
    public static String getUnicodeText(Object text)
            throws UnsupportedEncodingException {
        if (text == null) {
            return null;
        } else if (text instanceof byte[]) {
            return new String((byte[]) text, "UTF-8");
        } else {/*from w  ww. j a v a  2s  .com*/
            return String.valueOf(text);
        }
    }
}

Related

  1. getUnicodeByteArray(String str)
  2. getUnicodeBytes(String s)
  3. getUnicodeString(byte bytes[], int offset, int len)
  4. getUnicodeString(byte[] d, int length, int pos)
  5. toUnicode(char c)
  6. toUnicode(final String toUnicode, final boolean toLowerCase)
  7. toUnicode(String input)
  8. toUnicode(String input)