com.xiaoleilu.hutool
类 CharsetUtil
java.lang.Object
com.xiaoleilu.hutool.CharsetUtil
public class CharsetUtil
- extends Object
字符集工具类
- 作者:
- xiaoleilu
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ISO_8859_1
public static final String ISO_8859_1
- 另请参见:
- 常量字段值
UTF_8
public static final String UTF_8
- 另请参见:
- 常量字段值
GBK
public static final String GBK
- 另请参见:
- 常量字段值
CharsetUtil
public CharsetUtil()
convert
public static String convert(String source,
String srcCharset,
String newCharset)
- 转换字符串的字符集编码
- 参数:
source - 字符串srcCharset - 源字符集,默认ISO-8859-1newCharset - 目标字符集,默认UTF-8
- 返回:
- 转换后的字符集
str
public static String str(byte[] data,
String charset)
- 将编码的byte数据转换为字符串
- 参数:
data - 数据charset - 字符集,如果为空使用当前系统字符集
- 返回:
- 字符串
Copyright © 2014. All rights reserved.