Here you can find the source of iso2Gb(String gbString)
Parameter | Description |
---|---|
gbString | The string of GB1212 encoding |
public static String iso2Gb(String gbString)
//package com.java2s; public class Main { /**// ww w . j a va2 s .co m * Converts string from GB2312 encoding ISO8859-1 (Latin-1) encoding. * * @param gbString * The string of GB1212 encoding * @return New string of ISO8859-1 encoding */ public static String iso2Gb(String gbString) { if (gbString == null) return null; String outString = ""; try { byte[] temp = null; temp = gbString.getBytes("ISO8859-1"); outString = new String(temp, "GB2312"); } catch (java.io.UnsupportedEncodingException e) { // ignore it as no way to convert between these two encodings } return outString; } }