Zxing Chinese garbled solution Summary
I tried many methods and finally found that this method solves the most garbled code .......
Search for QR code images in Baidu
After the test on the first two pages, the results can be scanned out of a single graph.
If you have a better solution, please contact me. Thank you.
The solution is as follows:
First, use the Reflection Method to Determine the scan result.
Is it ISO8859-1 encoding format?
The scan results are converted to GB2312 in ISO8859-1 encoding format
If it is not a ISO8859-1 code, it will be displayed directly...
I wrote a tool class
/*** Chinese Garbled text ** solves most Chinese Garbled text temporarily, but some Garbled text cannot be solved. ** if you have a good solution, please contact me * I will be happy to ask you for your thanks ** @ return */private String recode (String str) {String formart = ""; try {boolean ISO = Charset. forName ("ISO-8859-1 "). newEncoder (). canEncode (str); if (ISO) {formart = new String (str. getBytes ("ISO-8859-1"), "GB2312"); Log. I ("1234 ISO8859-1", formart);} else {formart = str; Log. I ("1234 stringExtra", str) ;}} catch (UnsupportedEncodingException e) {// TODO Auto-generated catch blocke. printStackTrace ();} return formart ;}
Passing the scan result to this method will return a parsed string.
Hope to be useful to you
Http://download.csdn.net/detail/aaawqqq/7281577 Resources