qrencoder
qrencoder copied to clipboard
Normalize input to UTF-8
Most qr encoders and decoders assume the text payload is in UTF-8 encoding. So for example this fails currently:
x <- "fa\xE7ile"
Encoding(x) <- "latin1"
print(x)
png('test.png')
plot(qrencoder::qrencode_raster(x))
dev.off()
opencv::ocv_read('test.png') |> opencv::ocv_qr_detect()
I think the easiest solution is to normalize input using enc2utf8 inside qrencode_raw().