This project is read-only.

MECARD with QrCode.NET not working?

Feb 27, 2012 at 2:15 PM
Edited Feb 27, 2012 at 2:22 PM


Im trying to render a QR-Code that will be recognized as a Contact when scanned by Smartphones.
The string Im trying to render is:




MECARD:N:Firstname Lastname;NOTE:Companyname;ADR:Address;TEL:0123456;;URL:;;


Im rendering this string without any linebreaks in it.
When I render it with QrCode.Net and scan it with my smartphone I get the exact string displayed...
When I render it with Google API and scan it, the phone recognizes it as a contact...

So the QR-Code that is rendered with QrCode.Net is not recognized as a contact...

Do you know why this is happening? Any help is welcome!

This is the string rendered by QrCode.Net:

This is rendered by Google-API:

Feb 27, 2012 at 9:05 PM
Edited Feb 27, 2012 at 9:07 PM

I use i-ngma to parse both QrCode, it give me same result as mecard contact. Google decoder can not. By further investment on output, I found that by copy past your content to generate QrCode by QrCode.Net. The result I got is different to the one you post up there. 

Now I have use QrCode.Net to create a QrCode, uploaded to imageshack, you can check yourself.

After use ZXing decoder online and use browser's view source function you can find out exactly raw text. 

For the one I generate: 

MECARD:N:Firstname Lastname;NOTE:Companyname;ADR:Address;TEL:0123456;;URL:;;

Here is the one rendered by Google-API that you provide up there. 

MECARD:N:Firstname Lastname;NOTE:Companyname;ADR:Address;TEL:0123456;;URL:;;

And here is the one you create by QrCode.Net

MECARD:N:Firstname Lastname;NOTE:Companyname;ADR:Address;TEL:0123456;;URL:;;

The one you encode actually have some extra string at front. I don't know what's going on there, maybe you can find out. 


Note: As you can see, my image is exactly same as Google-API's one. How I generate is just use demo contain inside sourcecode and copy paste your input string. Our library use google-API as test reference, only two part is different. 

1. QrCode.Net will sometime generate QrCode one size smaller than Google-API. As they lack on determine algorithm to properly use most efficient size. 

2. We use auto detect for eight-bit encode where Google-API ask you to input encoding table(for example: iso-8859-1 ). That will cause Google-API turn some character that not belong to that encoding table to become question mark. You can easily test out by select character encoding to iso-8859-1 and input text with some japanese, korean or chinese on ZXing generator page. You will find out result during decode is all question mark. 

That's only output viable different between two encoder. Other difference will be just algorithm we use, but result will be exactly same. 

Hope that helps you. 


Feb 29, 2012 at 6:52 AM
Edited Feb 29, 2012 at 7:15 AM

Thanks for your detailed reply.

Im sorry but I cant confirm your thoughts.
The string you mentioned seems to be caused by the ZXing Decoder. If you download my QR-Code and decode it with ZXing by uploading instead of giving the URL, der string is not there.

I also copied the MECARD-String to your Demo Program and scanned the Code with Barcode Scanner, but its not working... What the heck am I doing wrong?

May there be some issues with the charset? I saw a setting for default encoding in some file of, but cant find it anymore... Can you give me the filename?

Thanks a lot for your help!


I downloaded the newest build and now its working with the demo application. Im going to try to recompile my program with that build and see if it works.

Feb 29, 2012 at 9:14 AM

Which version did you use before? If you could provide I might be able to find out reason. 

Default encoding is for different ISO/IEC documentation. It's mainly for which encoding table to use for eight bit byte encoding. 

Feb 29, 2012 at 10:59 AM

Before I used 11247.

Im trying now with the latest build. But Im recoding my program at the moment because I needed to change a lot of things...

I will give feedback again when recode is complete and I managed to generate QR-Codes with the new build.

Feb 29, 2012 at 11:40 AM

Everything seems to work now as expected :) Thanks for your help!

This QR-Code-Generator ist really nice work :)