DataMatrix Font Encoder version 2023 gives a different output compared to old
We have recently updated the Font encoder assemblies to the latest version (shipped in 2023) and notice differences in the encoded output when we compare the results with the previous assembly version from 2021.
I have created a Repro app in C# with the following body
`//#define VERSION2023
namespace EncodingValidate
{
using IDAutomation.NetStandard.DataMatrix.FontEncoder;
internal class Program
{
static void Main(string[] args)
{
DataMatrix dataMatrix = new DataMatrix();
string InputText = " ~!"#$%&\''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}";
string assemblyName = dataMatrix.GetType().Assembly.FullName;
Console.WriteLine($"Data Matrix Font Encoder:: {assemblyName}");
Console.WriteLine($"Input:: '{InputText}'");
// NOTICE: The EncodingModes enum is updated in the 2023 version, and the Ascii value used to be ASCII in the old version
if VERSION2023
string OutputAutoText = dataMatrix.EncodeDM(InputText, true, EncodingModes.Auto, -1, OutputTypes.IDA2DFont, null);
string OutputAsciiText = dataMatrix.EncodeDM(InputText, true, EncodingModes.Ascii, -1, OutputTypes.IDA2DFont, null);
Console.WriteLine($"Output(Ascii):: '{OutputAsciiText}'");
Console.WriteLine($"Output(Auto):: '{OutputAutoText}'");
else
string OutputAsciiText = dataMatrix.EncodeDM(InputText, true, EncodingModes.ASCII, -1, OutputTypes.IDA2DFont, null);
Console.WriteLine($"Output(Ascii):: '{OutputAsciiText}'");
endif
}
}
}
`
When you run the code and look at the Ascii output you get
Data Matrix Font Encoder:: IDAutomation.NetStandard.DataMatrix.FontEncoder, Version=2021.0.0.0, Culture=neutral, PublicKeyToken=b6fc8ebd9908403e
Input:: ' ~!"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}'
Output(Ascii):: 'ANGPCLBPHNGIGPAPAPCKAKHNFPEOAJCJDPGKBIHK
ADJNHNHEKGJNAHLOLNMKAFEGJJGBLFOLHKLLIDOK
AFHFNGGNNMMMPNOHIPIKANCBJHOEBACGCMGKPBCK
ABBNJMFADFOFIHJNGBJKAFGNAAGFFEJICBMDJPGK
AMEAGEMGAOIKCIKGCEAKAEAGACCCOAKEEMMKOIEK
AMDJENCOBKCNCPANBNGKALELGOHOHJAPFKFNHPFK
ADGHAKGNKFIEIDDIGGMKAFAIHJMBGHJNHGBLCDAK
AOCNIHAMJDFLBFLIPOKKAEGHKPCFDNHJILDJBNPK
AFAFIHAKNKAEIKKALPGKAGKDICEEGFGCGPLJGHJK
AGEIOEKEGGOOMCOEOIGKACEACGCOKEGKCGAMGMIK
'
Data Matrix Font Encoder:: IDAutomation.NetStandard.DataMatrix.FontEncoder, Version=2023.1.22.0, Culture=neutral, PublicKeyToken=b6fc8ebd9908403e
Input:: ' ~!"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}'
Output(Ascii):: 'AMAMCPDNENGNCLAPCPCKAPDJEPGOBICNEIBKBMAK
ALJPENPEODINDPDPPJNKAEGPAIGELHMMINPLIDHK
AGJENHLLHEEBDBOHCHBKAMCELEMEJBGCCMGOJGOK
ALGLJEEBHBOEKOAOGEJKAHENIECBEEILCNECKDEK
ACAECAMGKGAKCMIEEEIKAEECACCEOEKKKIKEECIK
AODJEPAOBLGJCPCMAOGKAPEKGKHJBMDJELCMEPAK
AEAHIPCJKEKMBCDMGHNKACEPECKDKEECCPJOPCLK
APGJIHKEACEPBELIPOMKAJDKHEGJKLCJOMGDDJMK
AECNBGAONKAEIKICELBKAEPMOOLAOEMCOEIPJPBK
AGEMOEKEGGOOGCAEGEOKAGGIEGKCCIEMGGIAKAIK
'
It's noticeable that when I use Auto|Ascii for the 2023 version, I am able to scan the QR code with my phone and get the original string (Using an IDAutomation barcode verified app on Android)
Can you elaborate on this difference in encoding output, which one is the correct string. I cannot push the update to production before I am very sure that it will not break our customers QR / barcodes.
The differences have been seen on
DataMatrix, QRCode, Pdf417, MaxiCode,
I have attached my C# repro project files and the txt output I have generated.
Operating System:
Windows 10+
Attachments:
09-12-25 5 hr(s) ago
 Report Abuse
|