Question

I am facing a problem which I guess little unfamiliar out there (as, searching on google, I found no hint). I am trying to generate QR code using the TCPDF provided class. Almost everything is working fine. I am being able to generate anykind of website link etc.

But when I am trying to generate QR for "Sending Email" and "WiFi Login for android" but they are not getting encoded(or decoded?) properly.

   MATMSG:TO:example@example.com;SUB:Hello;Body:example;;

is getting decoded as

   example@example.com;SUB:Hello;Body:example;;

and

   WIFI:T:WEP;S:affaf;P:aaaa;;

is getting decoded as

  WEP;S:affaf;P:aaaa;;

Further I have noticed that encoding MATMSG is the main problem. I tried this http://blog.qr4.nl/Online-QR-Code_Decoder.aspx to decode QR. They can't decode the QR for MATMSG

But interestingly, QR generated from http://www.qrstuff.com/ for sending email is working perfectly in that decoder. More interestingly, if you just encode the MATMSG using this site's plain text option that doesn't work.

Is there anything tricky for encoding MATMSG ? or could you suggest anything to encode that?

Well, I should mention

   matmsg:TO:example@example.com;SUB:Hello;Body:example;;

   wifi:T:WEP;S:affaf;P:aaaa;;

are getting encoded and decoded nicely. Will those work for sending email and wifi login accordingly? or

   MATMSG:
   TO:example@example.com;SUB:Hello;Body:example;;

   WIFI:
   T:WEP;S:affaf;P:aaaa;;

will these work?

Thanks for your time. Cheers!

Was it helpful?

Solution

Your first MATMSG is correct except that "Body" should be "BODY". The WIFI message is correct.

The rest is a function of the particular decoder to support or not. zxing supports these and so I believe (with the correction above) and I believe you are doing it all correctly regarding encoding. You can't fix decoders that don't support it.

OTHER TIPS

Keep in mind that there are three different formats for encoding a email in a QR:

Mailto (W3C standard)

mailto:email@example.com?subject=email subject&body=Email text

MATMSG (NTT DoCoMo)

MATMSG:TO: email@example.com;SUB:email subject;BODY:Email text;;

SMTP (OMI@)

SMTP:email@example.com:email subject:Email text

Although MATMSG is the most widespread, there are some readers (ie: ScanLife) that doesn't support it

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top