Is UTF-8 the encoding of choice for QR codes with non-ASCII characters?

Google uses UTF-8 by default for its very popular encoder. From what I see, they don’t even add a byte order mark.

The problem is that most scanners still use JIS8 (QR 2000) instead of iso-8859 (QR 2005) by default, so it basically doesn’t work to use iso-8859 for encoding.

Utf-8 seems to be the only choice, even if it is against the spec.

edit: I will go with utf-8 without ECI and without spec. Against all speculation and spirit, but works best at the moment.

+4
source share
1 answer

The specification states that ISO-8859-1 is the default for byte encoding. However, in practice, yes, you will see a lot of Shift-JIS in Japan or UTF-8.

UTF-8 is the right choice. To do this correctly, you need to indicate in the stream that it is UTF-8. The specification really allows this. Before the byte segment , you need an ECI segment that indicates UTF-8.

The zxing encoder will do this for you if you send him a hint that the encoding is UTF-8.

+11
source

Source: https://habr.com/ru/post/1401331/


All Articles