text

Create an NFC Forum Text Record.

Synopsis

ndeftool text [OPTIONS] TEXT
ndeftool txt [OPTIONS] TEXT

Description

The text command creates an NFC Forum Text Record with the given input text. The text language defaults to English (language code en) and can be set with --language followed by the IANA language code. The text content is encoded as UTF-8 or UTF-16 depending on --encoding. The default encoding is UTF-8.

Options

-l, --language TEXT

Set the IANA language code.

--encoding [UTF-8|UTF-16]

Set the encoding (default UTF-8).

--help

Show this message and exit.

Examples

Create an NFC Forum Text Record with the default language en and encoding UTF-8.

$ ndeftool text 'created with the nfcpy ndeftool' print
NDEF Text Record ID '' Text 'created with the nfcpy ndeftool' Language 'en' Encoding 'UTF-8'

Create one text record with English text and one record with German text.

$ ndeftool text --language en 'English' text --language de 'Deutsch' print
NDEF Text Record ID '' Text 'English' Language 'en' Encoding 'UTF-8'
NDEF Text Record ID '' Text 'Deutsch' Language 'de' Encoding 'UTF-8'

Create a text record with UTF-16 encoding.

$ ndeftool text --encoding UTF-16 'text encoded in UTF-16' | xxd -g 1
00000000: d1 01 31 54 82 65 6e ff fe 74 00 65 00 78 00 74  ..1T.en..t.e.x.t
00000010: 00 20 00 65 00 6e 00 63 00 6f 00 64 00 65 00 64  . .e.n.c.o.d.e.d
00000020: 00 20 00 69 00 6e 00 20 00 55 00 54 00 46 00 2d  . .i.n. .U.T.F.-
00000030: 00 31 00 36 00                                   .1.6.