Java String Decode decode(String str, String encoding)

Here you can find the source of decode(String str, String encoding)

Description

decode

License

Open Source License

Declaration

static public String decode(String str, String encoding) 

Method Source Code


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

public class Main {
    static public String decode(String str, String encoding) {
        if (str == null || str.length() == 0)
            return str;
        try {/*from w ww  .  j  av a2s.c o  m*/
            return new String(str.getBytes("iso-8859-1"), encoding);
        } catch (UnsupportedEncodingException e) {
            return str;
        }
    }
}

Related

  1. decode(String s, String charset1, String charset2)
  2. decode(String s, String enc, boolean plusToSpace)
  3. decode(String s, String encoding)
  4. decode(String str)
  5. decode(String str)
  6. decode(String string, String encoding)
  7. decode(String text)
  8. decode(String value, String encoding)
  9. decode3(String str)