public String decodeStr(byte[] bytes, String charset) throws BusinessException { String result = null; if (bytes != null) {
if (charset != null && !charset.trim().equals("")) { try { result = new String(bytes, charset); } catch (UnsupportedEncodingException e) { throw new BusinessException("转换字符编码GB2312失败!原因:不支持字符集 " + charset + " !"); } } else { result = new String(bytes); }
} return result; }