package cmis.common;

import java.io.IOException;

public class Encoding {

	public Encoding() {
	}

	public static String IsoToGb(String in) {
		String out = "";
		if (in == null) {
			return "";
		} else {
			try {
				out = new String(in.getBytes("iso-8859-1"), "gb2312");
			} catch (IOException ex) {
				System.err.println("Encoding IOException : " + ex.getMessage());
			}
			return out;
		}
	}

	public static String GbToIso(String in) {
		String out = "";
		if (in == null) {
			return "";
		} else {
			try {
				out = new String(in.getBytes("gb2312"), "iso-8859-1");
			} catch (IOException ex) {
				System.err.println("Encoding IOException : " + ex.getMessage());
			}
			return out;
		}
	}
}