Read Unicode text from 2d barcodes using Java

How to read 2d barcodes encode Unicode text in Java class, Servlet, web, J2EE applications?



How to scan, read 2d barcodes from image using Java?

  1. Download Java 2D Barcode Reader Library
  2. Install Java barcode jar SDK to read, decode Unicode text from 2D barcode images in Java web and desktop applications.
  3. Step by Step Tutorial












Unicode text and 2D Barcode Symbologies for Unicode texting encoding

You can easily convert digits, alphanumeric data message into barcodes. If you want to encode Unicode Latin-based characters to barcodes, you need process the Unicode text first, then conver to 2d barcodes.

Here is the most common method to convert Unicode text into barcodes.

  • Convert Unicode text string to byte array using UTF-8 encode
  • Create 2d barcodes from converted byte array


The following 2d barcode symbologies supports byte array encoding mode:
  • Data Matrix
  • PDF-417
  • QR Code





How to read, decode Unicode text from barcodes in Java class using Java Barcode Reader?

The Java source code and text below explain how to use Java code to read Unicode text from 2d barcodes, such as QR Code, Data Matrix and PDF-417 symbologies.
  • Utilize method BarcodeScanner.ScanInDetails() to get all QR Code data messages from existing image files
  • Call method BarcodeDetail.GetDataBytes() to get the barcode data in byte array object
  • Use System.Text.Encoding.UTF8.GetString() to convert byte array to Unicode with UTF-8 encode

BarcodeDetail[] datas = BarcodeScanner.ScanInDetails(
	    "qrcode-unicode-sample.png", BarcodeType.QRCode);
	            
for (int j = 0; j < datas.length; j++) {
	String textMsgDecoded = new String(datas[j].getDataBytes(), "UTF-8");
	System.out.println("Unicode text: " + textMsgDecoded);
}





































Terms of Use | Privacy Policy
Copyright © OnBarcode.com . All rights reserved.