Java tutorial
//package com.java2s; import java.nio.charset.Charset; public class Main { public static String getString(byte[] bytes, String charsetName) { return new String(bytes, Charset.forName(charsetName)); } public static String getString(byte[] bytes) { return getString(bytes, "GBK"); } }