Java UTF from toUTF8(String s, String encoding)

Here you can find the source of toUTF8(String s, String encoding)

Description

to UTF

License

Open Source License

Declaration

public static String toUTF8(String s, String encoding) throws Exception 

Method Source Code

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

public class Main {
    public static String toUTF8(String s, String encoding) throws Exception {
        if (s != null && s.length() > 0) {
            byte[] byteTmp = s.getBytes(encoding);
            s = new String(byteTmp, "UTF-8");
        }/*from  w  ww .j a  va2s  .  com*/
        return s;
    }
}

Related

  1. toUtf8(final String string)
  2. toUtf8(String hex)
  3. toUTF8(String oldStr)
  4. toUtf8(String s)
  5. toUTF8(String s)
  6. toUTF8(String str)
  7. toUTF8(String string)
  8. toUtf8(String texto)
  9. toUTF8ByteArray(String s)