Encode extended ASCII characters in Code 128 barcode

I want to encode the string “Quiñones” in the Code 128 barcode. Is it possible to include extended ASCII characters in the Code 128 encoding ?.

I did some research on Google that suggested this was possible with FNC4, but I did not find exactly how to do this. It would be very helpful if someone could help me with a solution in C.

+2
c extended-ascii barcode non-ascii-characters code128
source share
1 answer

"Extended ASCII characters" with byte values ​​from 128 to 255 can indeed be represented in Code 128 encoding using the special character of the FNC4 function. For general use (in open applications) it is necessary that such characters belong to the ISO-8859-1 character set (Latin1).

One FNC4 character acts as a transition to an extended character set for the next character, while two consecutive FNC4 characters act as a latch. The effect is to switch the high bit (mainly to add or subtract 128) of the 8-bit ASCII value for the affected characters.

In your Quiñones example, the character “Ñ” is represented by byte 209 in the default character set ISO-8859-1, so 128 + 81. ASCII 81 allows “Q”, so the FNC4 Q sequence is required to represent “Ñ”.

The effective encoding of 128 such data is as follows:

 [104/START-B] [49/Q] [85/u] [73/i] [100/FNC4] [49/Q] [79/o] [78/n] [69/e] [83/s] [93/check-digit] [106/STOP] 

Some applications and barcode libraries will use advanced FNC4 encoding for you, as in the example below. Most are not, but they should allow you to specify the FNC4 symbol directly so that you can manually control the process using the above method, for example: Qui{FNC4}Qones

The Code 128 symbol is as follows:

Code 128 containing the word "QuiÑones"

It was generated using the Online Barcode Generator with the following parameters:

 Barcode: Code 128 Contents: Qui^209ones Options: parse height=0.5 
+5
source share

All Articles