Java GBK String Convert gbk2iso(String s)

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

Description

gbkiso

License

Apache License

Declaration

public static String gbk2iso(String s) 

Method Source Code

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

import java.io.UnsupportedEncodingException;

public class Main {
    public static String gbk2iso(String s) {
        return convertCode(s, "GBK", "ISO8859_1");
    }//from w ww .j a  v a2 s  . c o m

    public static String convertCode(String s, String from_charset, String to_charset) {
        if (s != null) {
            try {
                return new String(s.getBytes(from_charset), to_charset);
            } catch (UnsupportedEncodingException ex) {
                return s;
            }
        }
        return "";
    }
}

Related

  1. gbk2Iso(String str)
  2. gbk2Utf8(String str)
  3. getGBKByteLength(String data)