UseUtf16Encoding Method
UseUtf16Encoding(Boolean)
Encode the NDEF text using the UTF-16LE instead of UTF-8.
public ConfigureNdef UseUtf16Encoding(bool setOption = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | setOption |
Returns
The current ConfigureNdef instance.
Remarks
This setting only has an effect when programming the NDEF slot using AsText(String). If this is set and the AsUri(Uri) method is called, an exception will be thrown when calling Execute().
By default, the text that is configured into the NDEF slot is encoded using UTF-8. This is the standard that is overwhelmingly preferred for modern operating systems. Some platforms, such as Microsoft Windows, use UTF-16 little endian encoding internally. However, when interacting with other systems, they still interpret UTF-8 encoding with no loss of functionality or compatibility. The option to use UTF-16 encoding is provided to you, but you are strongly advised to consider whether this is the correct choice for your scenario. If you aren't certain of the choice, then the default (UTF-8) is the correct choice and you should not call this method.