|
|
|
|
@ -49,7 +49,7 @@ public class Utils { |
|
|
|
|
return hasCamera && hasPhone && hasBT; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isGBK(byte[] bytes) { |
|
|
|
|
public static boolean isGbk(byte[] bytes) { |
|
|
|
|
Charset charset = Charset.forName("GBK"); |
|
|
|
|
String str = new String(bytes, charset); |
|
|
|
|
byte[] newBytes = str.getBytes(charset); |
|
|
|
|
@ -57,7 +57,7 @@ public class Utils { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static byte[] toUtf8(byte[] bytes) throws Exception { |
|
|
|
|
return isGBK(bytes) ? new String(bytes, Charset.forName("GBK")).getBytes("UTF-8") : bytes; |
|
|
|
|
return isGbk(bytes) ? new String(bytes, Charset.forName("GBK")).getBytes("UTF-8") : bytes; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static boolean isSub(String ext) { |
|
|
|
|
|