We are using Aspose.Words and noticed that when trying to print ñ using Code128, our process fails with the following error: ERROR: class com.aspose.barcode.BarCodeException: Code128 - unexpected symbol in the codetext.
Question: Does Aspose Barcode generator support printing these characters using Code128?
The Aspose Barcode generator does not support the character “ñ” when using Code128. Code128 is designed to encode a specific set of characters, and while it supports the full ASCII 128 character set, it does not include certain special characters like “ñ”.
To resolve this issue, you might consider using a different barcode type that supports a wider range of characters, such as Code 39 or Code 93, which can accommodate more special characters. Alternatively, you could encode the character “ñ” using a different representation, such as using a combination of characters that are supported by Code128.
If you need further assistance or examples on how to implement this, feel free to ask!
Code 128 encodes all 8-bit characters well. We had issue with version before 2022 with encoding second half of 256 characters, but it was fixed (I do not remember which version). In this way you have to just update the library.
BarcodeGenerator gen = new BarcodeGenerator(EncodeTypes.Code128, "ñ");
//save to test
gen.Save(@"d:\save\rec\gen_this.png", BarCodeImageFormat.Png);
using (BarCodeReader reader = new BarCodeReader(gen.GenerateBarCodeImage(), DecodeType.Code128))
{
foreach (BarCodeResult result in reader.ReadBarCodes())
Console.WriteLine(result.CodeText);
}
Thanks @alexander.gavriluk . Does this mean, with the latest BarCodeGenerator code we should be able to display ‘latin’/special characters without any issues?