diff --git a/lib-zxing/src/main/java/com/uuzuche/lib_zxing/activity/CodeUtils.java b/lib-zxing/src/main/java/com/uuzuche/lib_zxing/activity/CodeUtils.java index 4026c54..582cfd6 100644 --- a/lib-zxing/src/main/java/com/uuzuche/lib_zxing/activity/CodeUtils.java +++ b/lib-zxing/src/main/java/com/uuzuche/lib_zxing/activity/CodeUtils.java @@ -66,7 +66,7 @@ public static void analyzeBitmap(String path, AnalyzeCallback analyzeCallback) { MultiFormatReader multiFormatReader = new MultiFormatReader(); // 解码的参数 - Hashtable hints = new Hashtable(2); + Hashtable hints = new Hashtable(3); // 可以解析的编码类型 Vector decodeFormats = new Vector(); if (decodeFormats == null || decodeFormats.isEmpty()) { @@ -78,8 +78,8 @@ public static void analyzeBitmap(String path, AnalyzeCallback analyzeCallback) { decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS); } hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats); - // 设置继续的字符编码格式为UTF8 - // hints.put(DecodeHintType.CHARACTER_SET, "UTF8"); + hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE); + hints.put(DecodeHintType.CHARACTER_SET, "utf-8"); // 设置解析配置参数 multiFormatReader.setHints(hints);