How to Write Unicode and International Language Barcodes in C# | IronPDF

How to write Unicode and International Languages Barcodes in C

IronBarcode enables developers to generate barcodes containing Unicode text in multiple languages (Chinese, Arabic, Thai, etc.) using encodings like DataMatrix or QR Code, which natively support UTF-8 characters for international product labeling.

Quickstart: Create a Unicode Barcode with DataMatrix Encoding

Generate a barcode containing mixed-language Unicode text using IronBarcode in one line, then save it as an image.

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronBarcode with NuGet Package Manager

    PM > Install-Package BarCode

  2. Copy and run this code snippet.

    var barcode = IronBarCode.BarcodeWriter.CreateBarcode("123 英語 اللغة العربية", IronBarCode.BarcodeWriterEncoding.DataMatrix);
    barcode.SaveAsImage("unicode.png");
  3. Deploy to test on your live environment

    Start using IronBarcode in your project today with a free trial
    arrow pointer

How Do I Create a Unicode Barcode with Mixed Languages?

IronBarcode supports writing and generating barcodes in Unicode, allowing developers to create strings that contain multiple languages as barcode values. For instance, a string that includes a mix of Chinese, Arabic, and Thai can be handled directly.

Unicode support in barcode generation is essential for global applications, enabling businesses to create product labels, shipping documents, and identification systems that work across different languages and regions. The IronBarcode library provides seamless handling of UTF-8 encoded text, making it the ideal solution for international barcode requirements.

Below is the following string that we'll use as a barcode value.

string unicodeText = "周態告応立待太記行神正用真最。音日独素円政進任見引際初携食。更火識将回興継時億断保媛全職。文造画念響竹都務済約記求生街東。天体無適立年保輪動元念足総地作靖権瀬内。失文意芸野画美暮実刊切心。感変動技実視高療試意写表重車棟性作家薄井。陸瓶右覧撃稿法真勤振局夘決。任堀記文市物第前兜純響限。囲石整成先尾未展退幹販山令手北結。أم يذكر النفط قبضتهم على, الصين وفنلندا ما حدى. تم لكل أملا المنتصر, ٣٠ حدى مارد القوى. شرسة للسيطرة قامفي. حتى أم يطول المحيط, زهاء وحلفاؤها من فعل. لم قامت الجو الساحلية وتم, ويعزى واقتصار قبل كل۔ภคนทลาพาธสตารเซฟต แชมป มารเกตตงลมเหลวโยเกรต แลนดบาบนอมครม รสโซ แบรนดไคลแมกซ พซซาโมเดลเสอโครง มอบโซนรายชอ แอดมชชน ดอกเตอร พะเรอ มารคเจไดโมจราสเบอรร เอนทรานซออดชนศลปวฒนธรรมเปราะบาง โมจซเรยสวอลนตทรป";
string unicodeText = "周態告応立待太記行神正用真最。音日独素円政進任見引際初携食。更火識将回興継時億断保媛全職。文造画念響竹都務済約記求生街東。天体無適立年保輪動元念足総地作靖権瀬内。失文意芸野画美暮実刊切心。感変動技実視高療試意写表重車棟性作家薄井。陸瓶右覧撃稿法真勤振局夘決。任堀記文市物第前兜純響限。囲石整成先尾未展退幹販山令手北結。أم يذكر النفط قبضتهم على, الصين وفنلندا ما حدى. تم لكل أملا المنتصر, ٣٠ حدى مارد القوى. شرسة للسيطرة قامفي. حتى أم يطول المحيط, زهاء وحلفاؤها من فعل. لم قامت الجو الساحلية وتم, ويعزى واقتصار قبل كل۔ภคนทลาพาธสตารเซฟต แชมป มารเกตตงลมเหลวโยเกรต แลนดบาบนอมครม รสโซ แบรนดไคลแมกซ พซซาโมเดลเสอโครง มอบโซนรายชอ แอดมชชน ดอกเตอร พะเรอ มารคเจไดโมจราสเบอรร เอนทรานซออดชนศลปวฒนธรรมเปราะบาง โมจซเรยสวอลนตทรป";
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

We then call the BarcodeWriter.CreateBarcode method to create the desired barcode. The method takes in two values: the text and the encoding. Learn more about creating barcodes from various data types including URLs, IDs, and binary data.

:path=/static-assets/barcode/content-code-examples/how-to/writing-in-unicode-write.cs
using IronBarCode;

// Unicode text with Chinese, Arabic and Thai characters
string text = "周態告応立待太記行神正用真最。音日独素円政進任見引際初携食。更火識将回興継時億断保媛全職。文造画念響竹都務済約記求生街東。天体無適立年保輪動元念足総地作靖権瀬内。失文意芸野画美暮実刊切心。感変動技実視高療試意写表重車棟性作家薄井。陸瓶右覧撃稿法真勤振局夘決。任堀記文市物第前兜純響限。囲石整成先尾未展退幹販山令手北結。أم يذكر النفط قبضتهم على, الصين وفنلندا ما حدى. تم لكل أملاً المنتصر, ٣٠ حدى مارد القوى. شرسة للسيطرة قامفي. حتى أم يطول المحيط, زهاء وحلفاؤها من فعل. لم قامت الجو الساحلية وتم, ويعزى واقتصار قبل كل。ภคันทลาพาธสตาร์เซฟตี้ แชมป์ มาร์เก็ตติ้งล้มเหลวโยเกิร์ต แลนด์บาบูนอึมครึม รุสโซ แบรนด์ไคลแม็กซ์ พิซซ่าโมเดลเสือโคร่ง ม็อบโซนรายชื่อ แอดมิชชั่น ด็อกเตอร์ พะเรอ มาร์คเจไดโมจิราสเบอร์รี เอนทรานซ์ออดิชั่นศิลปวัฒนธรรมเปราะบาง โมจิซีเรียสวอลนัตทริป";

// Create a DataMatrix barcode with the specified text
var myBarcode = BarcodeWriter.CreateBarcode(text, BarcodeWriterEncoding.DataMatrix);

// Save the barcode as an image
myBarcode.SaveAsImage("Unicode.jpeg");
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

This is the file that the code produced:

Output Unicode Barcode

For enhanced styling options, you can also customize your Unicode barcodes with colors, margins, and annotations to meet specific branding requirements.


Which Barcode Types Support Unicode Characters?

Unicode support varies by barcode type. Only selected barcode formats natively support Unicode and directly store Unicode text without encoding workarounds. Aside from the DataMatrix encoding we've done above, here's a quick list of encoding types that support Unicode.

Barcode TypeUnicode SupportBest ForMax Capacity
QR CodeFull UTF-8 (Kanji mode for CJK)Marketing, multilingual labels, IDs~3,000 chars (alphanumeric)
Data MatrixWith ECI (Extended Channel Interpretation)Industrial, small item labels~1,556 bytes
PDF417With ECI (but limited scanner support)Documents (boarding passes, IDs)~1,100 bytes
Aztec CodeNative UTF-8Mobile tickets, airline passes~3,000 chars

Note the difference in the number of characters you can fit with each barcode encoding type. For example, using the string above with PDF417 won't work, as it contains more than 500 Unicode characters. In this case, you need to implement a workaround to make it work. As such, it's important to note the length of your string.

The barcode types listed above are all available from BarcodeWriterEncoding.

For a complete list of all available barcode encoding types from BarcodeWriterEncoding, please refer to our supported barcode formats documentation.

Best Practices for Unicode Barcode Generation

When working with Unicode barcodes, consider these important factors:

  1. Character Encoding: Always ensure your source text is properly UTF-8 encoded before generating barcodes
  2. Scanner Compatibility: Verify that your barcode scanners support Unicode decoding for your chosen barcode type
  3. Data Size: Monitor the byte size of your Unicode text, as characters like Chinese or Arabic typically require 2-3 bytes each
  4. Error Correction: For critical applications, use higher error correction levels to ensure reliable scanning

For QR Code generation specifically, check out our comprehensive C# QR Code Generator tutorial which includes advanced Unicode handling techniques.

How Do I Read Unicode Barcodes in C#?

Aside from writing in Unicode, IronBarcode also supports reading Unicode barcodes. To read the barcode, we use the Read method from the BarcodeReader class with the provided parameter being the Unicode barcode.

Here's a quick example using the Unicode barcode generated from above:

:path=/static-assets/barcode/content-code-examples/how-to/writing-in-unicode-read.cs
using IronBarCode;
using System.IO;

// Reading the Unicode barcode
BarcodeResults result = BarcodeReader.Read("Unicode.jpeg");

// Output the text value from the barcode to a txt file
File.WriteAllText("text.txt", result[0].Text);
IRON VB CONVERTER ERROR developers@ironsoftware.com
$vbLabelText   $csharpLabel

Note that although you can output the text value to a terminal with Console.WriteLine, the terminal doesn't natively support displaying Unicode characters and requires additional setup. In this example, we directed the output to a txt file instead.

Output

Text editor showing multilingual Unicode text in Chinese, Arabic, and Thai scripts for barcode encoding example

Common Use Cases for Unicode Barcodes

Unicode barcode generation serves numerous practical applications across global industries:

  • International Product Labeling: Create product labels that display information in multiple languages for global distribution
  • Logistics and Shipping: Generate shipping labels with addresses in native scripts for accurate international delivery
  • Healthcare: Encode patient information including names in native languages for medical records and prescriptions
  • Event Management: Create tickets and passes with attendee names in their native scripts
  • Document Management: Generate document identifiers containing metadata in multiple languages

For more advanced barcode operations, explore our API Reference documentation to discover the full capabilities of IronBarcode's Unicode support.

Frequently Asked Questions

Why would I need to generate Unicode barcodes?

Generating Unicode barcodes is essential for supporting international languages such as Chinese, Arabic, and others, allowing businesses to operate across different regions and communicate effectively with diverse audiences.

Can IronBarcode handle Unicode characters?

Yes, IronBarcode supports generating barcodes with Unicode characters, making it possible to encode text in various international languages, including Chinese and Arabic.

What types of barcodes can I create with Unicode characters using IronBarcode?

With IronBarcode, you can create various types of barcodes, such as QR codes and Code 128, using Unicode characters. This flexibility is ideal for applications requiring internationalization.

Is it possible to customize the appearance of Unicode barcodes in IronBarcode?

Yes, IronBarcode allows you to customize the appearance of Unicode barcodes, including size, color, and text font, ensuring that the barcodes meet your specific design and branding requirements.

Do I need special software to read Unicode barcodes created with IronBarcode?

No special software is required to read Unicode barcodes created with IronBarcode. Standard barcode scanners and software applications capable of reading the specific barcode format can interpret them.

Can I generate barcodes with a mix of Unicode and ASCII characters?

Yes, IronBarcode supports generating barcodes that contain a mix of Unicode and ASCII characters, offering flexibility in encoding a wide range of data.

How does IronBarcode handle RTL (right-to-left) languages like Arabic?

IronBarcode is capable of handling right-to-left languages such as Arabic by properly encoding the text direction in the generated barcodes, ensuring accurate representation and readability.

What are the advantages of using IronBarcode for Unicode barcode generation?

IronBarcode offers ease of use, compatibility with various barcode formats, support for international languages, and customization options, making it an ideal choice for generating Unicode barcodes.

Is there a limit to the number of characters I can encode in a Unicode barcode with IronBarcode?

The number of characters you can encode in a Unicode barcode with IronBarcode depends on the barcode type and size. However, IronBarcode is designed to efficiently handle large amounts of data.

Can IronBarcode generate barcodes for both desktop and mobile applications?

Yes, IronBarcode can generate barcodes suitable for both desktop and mobile applications, providing versatility across different platforms and devices.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 2,002,059 | Version: 2025.12 just released