Re: [web-nfc] NDEFRecordInit#encoding should be only for BufferSource data source (#521)

Should we throw an error if `NDEFRecordInit#encoding` is neither 'utf-8' nor `undefined` for a DOMString data source?

I feel necessary as I always prefer tight checks, thus users passing 'utf-16' for a DOMString will not get a wrong understanding that the DOMString is successfully encoded as 'utf-16' and written into the nfc tag finally.

The context is https://chromium-review.googlesource.com/c/chromium/src/+/1991972/1/third_party/blink/renderer/modules/nfc/ndef_record.cc#153

-- 
GitHub Notification of comment by leonhsl
Please view or discuss this issue at https://github.com/w3c/web-nfc/issues/521#issuecomment-572853662 using your GitHub account

Received on Friday, 10 January 2020 03:11:10 UTC