flutter-nfc-manager icon indicating copy to clipboard operation
flutter-nfc-manager copied to clipboard

Wrong output from ndef message.

Open vadrian89 opened this issue 3 years ago • 0 comments

Hello, when trying to retrieve the content I get the string with other chars appended.

The content from the tag is "yoooo" as seen in the following screenshot: 5de0a7b4-2afb-465c-bb8c-ce4e6a48d203

The code

final message = ndef.cachedMessage;
final payload = message?.records[0].payload ?? const Iterable<int>.empty();
final payloadStr = String.fromCharCodes(payload);
print("payloadStr $payloadStr");

The printed output in the debug console: image

I have also tried:

final payload = message?.records[0].payload ?? <int>[];
final payloadStr = Utf8Decoder().convert(payload);

But it has the same result.

vadrian89 avatar Apr 26 '22 14:04 vadrian89