Unicode编码和解码问题在QRCode [英] Unicode Encoding and decoding issues in QRCode
问题描述
为了测试它,我使用了许多解码解决方案:
我正在尝试生成UTF-8 QRCode,以便我可以包含口音和Unicode字符。 p>- http:// zxing .org / w / decode.jspx - zxing项目也在Android中使用
- http://www.drhu.org/QRCode/QRDecoder.php - 一个PHP解码器
- http://zbar.sf.net - ZBar条形码阅读器 - 嵌入式的OpenSource和C项目
所有这些都给我一贯的结果。
但是,如果我试图使用zxing或Google Chart API来生成e QRCode,我无法正确解码。
我已经尝试过:
- 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
-
但是没有成功。
你知道我能做什么吗?你知道哪个编码用于工作图像?
解决方案出现的解决方案是将文本编码为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 :
- http://zxing.org/w/decode.jspx - The zxing project also used in Android
- http://www.drhu.org/QRCode/QRDecoder.php - a PHP Decoder
- 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 :
- http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=SHIFT_JIS&chl=R%C3%A9my+Hubscher
- http://chart.apis.google.com/chart?cht=qr&chs=200x200&choe=ISO-8859-1&chl=R%C3%A9my+Hubscher
- 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屋!