chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
706 stars 557 forks source link

fixed language code field length detection #219

Closed homer-jay closed 7 years ago

homer-jay commented 8 years ago

In Well Known NDEF records of RTD "Text", the first byte in the payload is the status byte. This byte contains, according to the spec:

bit number (0 is LSB) Content
7 0 for UTF-8, 1 for UTF-16
6 RFU (MUST be set to zero)
5..0 The length of the IANA language code.

So it is not 5 bits, but bits 5 to 0.

Source: NFC Forum Text Record Type Definition Technical Specification, p.4

don commented 8 years ago

@homer-jay thanks for this pull request, I'll have more time to look into it after Christmas