All of 2D (matrix) barcode symbologies do not support encoding Unicode text directly into barcodes. However most of 2d barcode specifications do support byte array data encoding.
Right now a lot of barcode generator software (desktop, web, or mobile) provide Unicode characters encode by using UTF8 encoding.
They will convert Unicode text into byte array using UTF8 encode, and generate 2d barcodes with byte array mode.
BarcodeLib Barcode Reader for C# library allows you to use one line of code to read, decode Unicode text from 2d barcodes, such as QR Code, Data Matrix and PDF417.
How to read QR Code barcode with Unicode text encoded using C#?
The QR Code image below contains the Japanese and English characters below using BarcodeLib
C# Barcode Generator library.
The following C# example will show how to read and decode the above QR Code using C# barcode reader library.
Call method BarcodeReader.BarcodeReader.ReadBarcode() to get the scanned QR Code barcodes information from an existing image file
For each recognized QR Code, call GetMessage() to get the QR Code data string using default UTF8 encode
Or you can also use the method GetMessage(Encoding.Unicode) to get the QR Code string by specified encode mode
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
stringinputFilePath="C://Projects//Demo-Files//qrcode-with-unicode.png";BarCode[]datas=BarcodeReader.BarcodeReader.ReadBarcode(inputFilePath,BarcodeReader.BarcodeReader.QRCODE);Trace.WriteLine("Total QR Codes found: "+datas.Length);foreach(BarCodebarcodeDataindatas){stringdataInUTF8=barcodeData.GetMessage();stringdataInUTF16=barcodeData.GetMessage(Encoding.Unicode);Trace.WriteLine("QR Code data in UTF8: "+dataInUTF8);//Trace.WriteLine("QR Code data in UTF16: " + dataInUTF16);}
After run the program, you can find the scanned QR Code data string in Unicode in VS output window.