java 判断字符串什么编码类型
来源:互联网 发布:node.js有没有用 编辑:程序博客网 时间:2024/06/05 15:21
- public static String getEncoding(String str) {
- String encode = "GB2312";
- try {
- if (str.equals(new String(str.getBytes(encode), encode))) {
- String s = encode;
- return s;
- }
- } catch (Exception exception) {
- }
- encode = "ISO-8859-1";
- try {
- if (str.equals(new String(str.getBytes(encode), encode))) {
- String s1 = encode;
- return s1;
- }
- } catch (Exception exception1) {
- }
- encode = "UTF-8";
- try {
- if (str.equals(new String(str.getBytes(encode), encode))) {
- String s2 = encode;
- return s2;
- }
- } catch (Exception exception2) {
- }
- encode = "GBK";
- try {
- if (str.equals(new String(str.getBytes(encode), encode))) {
- String s3 = encode;
- return s3;
- }
- } catch (Exception exception3) {
- }
- return "";
- }
0 0
- java 判断字符串什么编码类型
- java 判断字符串什么编码类型
- java 判断字符串什么编码类型
- (转)java 判断字符串什么编码类型
- 【java】判断字符串编码类型
- java 判断字符串编码类型
- java判断字符串所属的编码类型
- Java进阶(三十) 判断字符串编码类型
- Java进阶(三十) 判断字符串编码类型
- 判断字符串编码类型
- 判断字符串编码类型
- java判断字符串编码
- JAVA判断字符串编码
- JAVA判断文件编码类型
- JAVA判断文件编码类型
- JAVA判断文件编码类型
- 判断字符串的编码类型(GBK / UTF8)
- 判断字符串的编码类型(GBK / UTF8)
- 【数据】EAGLE算法数据
- 程序员如何提高工作效率
- Python 魔术方法指南
- 彻底理解position与anchorPoint
- 冒泡排序的简单实现
- java 判断字符串什么编码类型
- ZOJ 3329 One Person Game (概率dp 难)
- jstl - 控制输出的字数
- LeetCode | Reverse Words in a String
- 将展开Android状态栏的背景设置为透明模糊效果
- OC To Swift And Swift To OC
- 给定一个排好序的数组,从里面查找一个给定值出现的次数
- 保存用户账号信息;UUID、UDID、KeyChain、Devicetoken
- 锚点