Java UTF8 Encode toUTF8(String value)

Here you can find the source of toUTF8(String value)

Description

to UTF

License

Open Source License

Declaration

public static String toUTF8(String value) throws UnsupportedEncodingException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.UnsupportedEncodingException;

public class Main {
    public static String toUTF8(String value) throws UnsupportedEncodingException {
        if (value == null) {
            return "";
        }/*from ww w.j a  v  a2  s.c  o m*/
        byte[] b = value.getBytes("ISO-8859-1");
        return new String(b, "utf-8");
    }
}

Related

  1. toUTF8(String str)
  2. toUtf8(String str)
  3. toUTF8(String str)
  4. toUTF8(String str)
  5. toUTF8(String string)
  6. toUTF8ByteArray(char[] string)
  7. toUTF8Bytes(final String s)
  8. toUTF8Bytes(String src)
  9. toUTF8Bytes(String string)