I am using the new nfc write capabilities and are writing successful to tags. But my payload data becomes written in utf-16. I want it to be utf8. How do I accomplish that?
This is how I create and write the NDEF:
let textPayload = NFCNDEFPayload.wellKnownTypeTextPayload(string: tmp, locale: Locale(identifier: "En"))
self.ndefMessage = NFCNDEFMessage(records: [(textPayload!)])
tag.writeNDEF(self.ndefMessage!) { (error: Error?) in
print(error ?? "error")
if error != nil {
session.invalidate(errorMessage: "Update tag failed. Please try again.")
} else {
session.alertMessage = "Update success!"
session.invalidate()
}
}