About Unicode text in barcode
Most barcode symbologies do not support encode Unicode text directly into barcode symbols. However 2d barcodes (Such as QR Code, Data Matrix, and PDF-417) usually support encoding byte array data message. C# developers could convert Unicode text into byte array, and encode the byte array into barcode symbols.
During decoding barcode image using barcode reader software or device, C# developer could read byte array data from 2d barcode symbols, and decode the byte array into string with Unicode text.
During decoding barcode image using barcode reader software or device, C# developer could read byte array data from 2d barcode symbols, and decode the byte array into string with Unicode text.
How to scan, read Unicode text from 2D barcodes using C#?
In the following C# source code, we will show you how to read a QR Code barcode image with Unicode text (English, Chinese, and Japanese characters inside).
We will try to read and recognize the Unicode text content from the following QR Code image, which is generated by OnBarcode C# barcode generator library. You can view the C# demo code at How to generate QR Code with Unicode text using C#
The above QR Code encodes the following text message with English, Chinese, and Japanese characters inside
We will try to read and recognize the Unicode text content from the following QR Code image, which is generated by OnBarcode C# barcode generator library. You can view the C# demo code at How to generate QR Code with Unicode text using C#
The above QR Code encodes the following text message with English, Chinese, and Japanese characters inside
You can decode Unicode text from QR Code and other 2d barcode using specified text encoding mode using C# Barcode Reader library.
When you run the program, you will find the scanned QR Code data below.
Scan, decode GS1 text message from GS1 QR Code in ASP.NET Core web application:
- Get all QR Code data from a single image file using C# method BarcodeScanner.ScanInDetails()
- For each QR Code data, get the byte array of the data message using method BarcodeDetail.GetDataBytes()
- Get the Unicode text using UTF8 decoding in method System.Text.Encoding.UTF8.GetString()
string inputFilePath = "C://Input//csharp-qrcode-unicode-sample.png"; // scan all QR Code symbols in the image file BarcodeDetail[] datas = BarcodeScanner.ScanInDetails(inputFilePath, BarcodeType.QRCode); for (int j = 0; j < datas.Length; j++) { byte[] dataInBytes = datas[j].GetDataBytes(); string textMsgDecoded = System.Text.Encoding.UTF8.GetString(dataInBytes); Console.WriteLine("message: " + textMsgDecoded); }
When you run the program, you will find the scanned QR Code data below.
Scan, decode GS1 text message from GS1 QR Code in ASP.NET Core web application:
Common Asked Questions
Can C# Barcode Reader handle barcode with Unicode characters?
Yes. OnBarcode C# Barcode Reader library supports scan and decode Unicode text from scanned barcode image.
The barcode library can decode barcodes with various international languages, including Japanese and Arabic in C# program.
What types of barcodes can encode Unicode characters in C#?
Using C# Barcode Scanner SDK, you can decode QR Code, Data Matrix, and PDF417 encoding Unicode characters in C# ASP.NET Core, MVC, Window Forms
and WPF applications.
Can I read barcodes with Unicode and ASCII characters combined in C#?
Yes. C# Barcode Scanner library supports reading barcodes which are encoding Unicode and ASCII characters combined in C# applications.
Can I read barcodes with multiple language characters combined in C#?
Yes. C# Barcode Reader library supports scanning and decoding barcodes which are encoding multiple language characters in C# program. You can view the
C# example source code above to get the details.
Can I scan QR Code, Data Matrix with Unicode in Structured Append mode in C#?
QR Code and Data Matrix may use Structured Append mode in multiple symbols to store large Unicode data file. C# Barcode Reader supports
reading multiple QR Code and Data Matrix with Unicode text encoded in Structured Append mode.
Can C# Barcode Reader library scan barcodes in desktop, web and mobile applications?
Yes. C# Barcode Reader library can scan and recognize barcodes in desketop (console, winforms, wpf), web (asp.net, mvc, blazor) and
mobile applications.