Java ISO8859 Encode String iso8859(String Unicodestr)

Here you can find the source of iso8859(String Unicodestr)

Description

iso

License

Apache License

Declaration

public static String iso8859(String Unicodestr) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String iso8859(String Unicodestr) {
        if (Unicodestr == null) {
            return null;
        }//from   w  ww  .j  a  va2 s  .co  m

        String str = null;

        try {
            str = new String(Unicodestr.getBytes("KSC5601"), "8859_1");
        } catch (java.io.UnsupportedEncodingException e) {
            str = Unicodestr;
        } catch (Exception e) {
            return str;
        }

        return str;
    }
}

Related

  1. iso88591ToUtf8(String str)