QR Code Tech Info: MECARD Format
Now you are (hopefully) getting familiar with sharing your personal details using a QR Code, specifically your contact details. Here we go a little more in depth in exactly what it is you are sharing and how.
One small issue with the QR Code format is that is only defines how the entirely of the data is encoded and does not include any specification for defining specific types of information within this blockof information. That is, if you were to encode a string of information, the QR Code would be the same, regardless of the type of data. e.g. if we were to encode the text ‘Anonymous Aardvark’, that could be decoded as a contact name, a telephone number, a website address or an email address. Of course, if you were to try to dial this ‘telephone number’ or send an email to this ’email address’, it clearly will not work – but it is the application that will perform the sanity check on the data – the QR Code decoder itself is quite happy for you to claim that ‘Anonymous Aardvark’ is a valid telephone number.
So, one way around this potential problem is for the world to accept various standards of data definitions and code the relevant apps to recommend them. The MECARD is one such format. As it was the Japanese phone industry that pushed the QR Code into popularity, it seems reasonable to use DotCoMo‘s address card format as a standard.
The chances are, if you use a standard app or website to create a Contact QR code, it will use the MECARD format by default. Also, if you read a QR Code with this format of information, most likely your decoding application will recognise this format and understand it.
So, what’s inside the MECARD format?
The first few characters are ‘MECARD:’ and this helps the decoding software to understand what it is looking at. The rest of the fields are as follows. Note that a) no field is compulsory – you can skip any of them and b) each field can be repeated. However, most likely your decoding application will be happy with multiple telephone numbers for a single contact, but multiple names are going to give it problems
The field names used are:
N: Contact name (if comma separated, uses LASTNAME,FIRSTNAME)
SOUND: Contact name in Japanese (Kana). Same comma rules as N:
TEL: Telephone number
TEL-AV: Videophone Tel number
EMAIL: Email address
NOTE: Memo text field
BDAY: Birthday (YYYMMDD format)
ADR: Address. Comma separated: PO box, room number, house number, city, prefecture, zip code and country
NICKNAME: Display name
(for more complete specs, please see DotCoMo’s website
Let’s look at one and see what we can get.
MECARD:N:Anonymous Aardvark;ADR:The Highstreet Cityville Big State 55555555 United Kingdom;TEL:+1111111111;TEL:+3333333333;TEL:+2222222222;TEL:+4444444444;
Adding in some line breaks:
ADR:The Highstreet Cityville Big State 55555555 United Kingdom;
Now, at first glance, it seems fairly simple and comprehensive. However, taking some time to look deeper shows some potential problems that we should be aware of: specifically, there are 4 different telephone numbers, but no distinction between them. In this sample, we have a work, mobile, fax and home number, but no indication which is which.
If the same software is used to decode and encode the QR Code, then we should be alright, but there is no guarantee of this at all. Perhaps Encoder A believes that they are 1)work, 2)mobile, 3)fax, 4)home – but Decoder B believes they are 1)mobile, 2)work, 3)home 4)fax. The potential for mixing up a contact’s details is high.
A really good QR Code encoder will allow you to select which fields are included in the QR Code.
A really good and well-thought out QR Code decoder will allow you to edit the details of a contact and swap around the label of the various fields.
If you are creating your own QR Code for sharing your personal details (perhaps for printing on a business card, or similar), then it seems that the best option is to only include as much information as the MECARD standard defines; for example, one telephone number and one email address only.
If you are encoding QR Codes directly from your phone’s address book, be aware of the limitations of this format and choose an encoder that lets you limit the number of fields used.