如何区分QR码中的不同内容类型?
QR代码可以包含不同的内容(URL,vCard,Wifi配置...)-在QR代码的规范中,似乎没有对内容进行任何定义.
QR-Codes can contain different contents (URLs, vCards, Wifi-Configurations...) - in the specification of QR-Code seems nothing defined regarding content.
如何区分这些不同的内容类型?仅通过解析内容的前几个字符并匹配URL方案(http:,tel:,fb :)?还是代码中还有另一个魔术"值?
How these different content types are distinguished? Only via parsing the first few characters of the content and matching to URL schemes (http:, tel:, fb:)? Or is there another 'magic' value inside the code?
因此,如果不与阅读器应用程序兼容性赌博,似乎不可能在一个QR码中编码多个内容.一个网址和一些文本(用一个代码).
So it seems impossible to encode multiple contents in ONE QR-Code without gambling with reader-app-compatibility... e.g. one URL and some text in ONE code.
谢谢.
如何区分这些不同的内容类型?仅通过解析内容的前几个字符并匹配URL方案(http:,tel:,fb:)?
How these different content types are distinguished? Only via parsing the first few characters of the content and matching to URL schemes (http:, tel:, fb:)?
是的. QR码仅包含一串UTF-8字符.由QR扫描仪解释文本.
Yes. A QR Code just contains a string of UTF-8 characters. It is up to the QR Scanner to interpret the text.
通常,它将查看前几个字符,以查看它们是否与它识别的方案相匹配.
Typically it will look at the first few characters to see if they match a scheme it recognises.
因此,如果不与阅读器应用程序兼容性进行赌博,似乎就不可能在一个QR码中编码多个内容.一个网址和一些文本(用一个代码).
So it seems impossible to encode multiple contents in ONE QR-Code without gambling with reader-app-compatibility... e.g. one URL and some text in ONE code.
是的.通常,单个QR码包含一条信息.如果您的代码是http://example.com/\nVisit Us!
,那么某些读者可能会感到困惑.
That's right. Typically a single QR code contains a single piece of information. If you have a code which is http://example.com/\nVisit Us!
then it is likely that some readers will get confused.
您能做的最好的事情就是创建一个URL,该URL指向包含不同类型数据的网页.例如,我的QR码指向http://edent.tel/
,则网站上有mailto:
,http://
,VCARD
,tel:
等.
The best thing you can do it create a URL which points to a web page containing the different types of data. For example, my QR codes point to http://edent.tel/
the website then has mailto:
, http://
, VCARD
, tel:
etc.