Java String Decode decodeString(String s)

Here you can find the source of decodeString(String s)

Description

decode String

License

Open Source License

Declaration

public static String decodeString(String s) 

Method Source Code


//package com.java2s;
import java.io.UnsupportedEncodingException;

public class Main {
    public static String decodeString(String s) {
        try {/*from   w w  w  .j  a  va  2  s.co m*/
            if (s != null) {
                if (s.equals(new String(s.getBytes("iso8859-1"), "iso8859-1"))) {
                    s = new String(s.getBytes("iso8859-1"), "utf-8");
                }
            }
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return s;
    }
}

Related

  1. decode(String str, String encoding)
  2. decode(String string, String encoding)
  3. decode(String text)
  4. decode(String value, String encoding)
  5. decode3(String str)
  6. decodeString(String s, String charset)
  7. decodeString(String s, String encoding)
  8. decodeString(String str)
  9. decodeString(String str)