IRONSOFTWAREHOME
Set ECI Encoding Policy
using IronBarCode;

// Set the ECI policy once for every 2D barcode
BarcodeWriter.DefaultEciMode = EciMode.ForceUtf8;

// Follows the policy with no further arguments
GeneratedBarcode qr = BarcodeWriter.CreateBarcode("BK005|8389|0001", BarcodeEncoding.QRCode);
qr.SaveAsPng("policy-qr.png");

// Aztec follows the same policy
GeneratedBarcode aztec = BarcodeWriter.CreateBarcode("BK005|8389|0001", BarcodeEncoding.Aztec);
aztec.SaveAsPng("policy-aztec.png");
Imports IronBarCode

' Set the ECI policy once for every 2D barcode
BarcodeWriter.DefaultEciMode = EciMode.ForceUtf8

' Follows the policy with no further arguments
Dim qr As GeneratedBarcode = BarcodeWriter.CreateBarcode("BK005|8389|0001", BarcodeEncoding.QRCode)
qr.SaveAsPng("policy-qr.png")

' Aztec follows the same policy
Dim aztec As GeneratedBarcode = BarcodeWriter.CreateBarcode("BK005|8389|0001", BarcodeEncoding.Aztec)
aztec.SaveAsPng("policy-aztec.png")
NuGet Download
PM > Install-Package BarCode
Set ECI Encoding Policy

Set ECI Encoding Policy

A UTF-8 ECI header tells a scanner how to interpret the bytes in a 2D barcode. IronBarcode adds one only when the data contains non-ASCII characters, which keeps ASCII payloads compact. Where a standard requires every symbol to declare its encoding, or a scanner fleet cannot handle ECI at all, one setting changes that decision for every 2D barcode the application produces.

3-Step Guide to Setting an ECI Encoding Policy

  • using IronBarCode;
  • BarcodeWriter.DefaultEciMode = EciMode.ForceUtf8;
  • GeneratedBarcode qr = BarcodeWriter.CreateBarcode("BK005|8389|0001", BarcodeEncoding.QRCode);

Code Explanation

We first import the IronBarcode library, then assign BarcodeWriter.DefaultEciMode. This is a static field, so a single assignment sets the policy for the whole application. EciMode.ForceUtf8 writes the header on every symbol, EciMode.Off never writes it, and EciMode.Auto is the default that writes it only for non-ASCII data.

Afterward, we generate barcodes exactly as we would without the setting. Neither CreateBarcode call passes an encoding argument, yet both the QR code and the Aztec code carry the header, because the static field is read each time a barcode is rendered. This makes it the only way to control ECI on QR, Aztec and PDF417, which have no per-call parameter of their own.

Assign the field once at application startup, before the first barcode is generated, so that every symbol produced afterward follows the same policy.

Explore the full guide to controlling UTF-8 ECI tagging!

Ready to Get Started?

Nuget Downloads 2,472,280Version:2026.10just released

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronBarcode
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package BarCode
nuget.org/packages/BarCode/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronBarCode"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

  1. Download and unzip IronBarCode to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronBarCode.dll"

Licenses from $999