Unicode编码和解码问题在QRCode [英] Unicode Encoding and decoding issues in QRCode

查看:166
本文介绍了Unicode编码和解码问题在QRCode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



为了测试它,我使用了许多解码解决方案:

我正在尝试生成UTF-8 QRCode,以便我可以包含口音和Unicode字符。 p>


  1. http:// zxing .org / w / decode.jspx - zxing项目也在Android中使用

  2. http://www.drhu.org/QRCode/QRDecoder.php - 一个PHP解码器

  3. http://zbar.sf.net - ZBar条形码阅读器 - 嵌入式的OpenSource和C项目

所有这些都给我一贯的结果。



你可以试试这个图像适用于< a> Unicode字符。



但是,如果我试图使用zxing或Google Chart API来生成e QRCode,我无法正确解码。



我已经尝试过:


  1. http: /chart> // $ href =http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=ISO-8859-1&chl=R%C3%A9my+Hubscher =noreferrer> http ://chart.apis.google.com/chart?cht = qr& chs = 200x200& choe = ISO-8859-1& chl = R%C3%A9my + Hubscher

  2. 但是没有成功。



    你知道我能做什么吗?你知道哪个编码用于工作图像?

    解决方案

    出现的解决方案是将文本编码为UTF -8,并添加一个BOM来指定字符串实际上是UTF-8。



    这里工作:




    I am trying to generate UTF-8 QRCode so that I can encore accents and Unicode characters.

    To test it, I am using many decoding solution :

    1. http://zxing.org/w/decode.jspx - The zxing project also used in Android
    2. http://www.drhu.org/QRCode/QRDecoder.php - a PHP Decoder
    3. http://zbar.sf.net - The ZBar bar code reader - OpenSource and C project for embedded

    All of them give me always the same result.

    You can try this image works well with Unicode Characters.

    But if I am trying to use zxing or Google Chart API to generate the QRCode, I cannot decode it correctly.

    I have tried this :

    1. http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=SHIFT_JIS&chl=R%C3%A9my+Hubscher
    2. http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=ISO-8859-1&chl=R%C3%A9my+Hubscher
    3. http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=UTF-8&chl=R%C3%A9my+Hubscher

    But all without success.

    Do you know how I can do ? Do you know which encoding is used for the working image ?

    解决方案

    The solution that comes up, is to encode the text in UTF-8 and add a BOM to specify that the string is actually in UTF-8.

    Here it works :

    这篇关于Unicode编码和解码问题在QRCode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆