Zxing Chinese garbled Solution

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.