qrcodejs icon indicating copy to clipboard operation
qrcodejs copied to clipboard

UTF-8 encoding support

Open 19z opened this issue 2 years ago • 5 comments

Now you can use text in other languages.

qrcode.makeCode("你好 こんにちは 여보세요");

19z avatar May 03 '22 03:05 19z

Nice work. This also fixes an overflow issue when using emojis.

qrcode.makeCode("🖤🌹");

jp-ed avatar Jun 13 '22 12:06 jp-ed

@19z Actually, it does not work in combination with VCARD. If I create a valid VCARD the umlaute "ö,Ö,ä,Ä,..." are not shown correctly. However, if I create a QR code just for a simple text line like "Österreich" it works pretty fine. Do you have any suggestions on that?

Example:

BEGIN:VCARD
VERSION:4.0
N:LÄstname;FirstNäme;;Title;
FN:Title FirstNäme LÄstname
END:VCARD

IMG_52C655939EE2-1

anka avatar Aug 04 '22 10:08 anka

@19z Actually, I does not work in combination with VCARD. If I create a valid VCARD the umlaute "ö,Ö,ä,Ä,..." are not shown correctly. However, if I create a QR code just for a simple text line like "Österreich" it works pretty fine. Do you have any suggestions on that?

Example:

BEGIN:VCARD
VERSION:4.0
N:LÄstname;FirstNäme;;Title;
FN:Title FirstNäme LÄstname
END:VCARD

IMG_52C655939EE2-1

I scanned it using another scanning tool and parsed the original text as you entered it. It doesn't seem to be a problem with the generator.

19z avatar Aug 04 '22 18:08 19z

@19z Ok, thanks for that. I did use an iPhone 12 Pro with iOS 15.4.1 and its native QR code scanning feature.

anka avatar Aug 04 '22 18:08 anka

@19z found a solution. Either use VERSION:3.0 or add the property CHARSET=UTF-8 to each appropriate line.

anka avatar Aug 05 '22 05:08 anka