Encode extended ASCII characters in a Code 128 barcode

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-29 15:20:52

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

A single FNC4 character acts as a shift to the extended character set for the next character whereas two consecutive FNC4 characters act as a latch. The effect is to toggle the high bit (basically to add or subtract 128) of the 8-bit ASCII value of the affected characters.

In your example "QuiÑones" the character "Ñ" is represented by byte value 209 in the default ISO-8859-1 character set, so that's 128+81. ASCII 81 resolves to "Q", so you require the sequence FNC4 Q to represent "Ñ".

An efficient Code 128 encodation of this 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 barcode applications and libraries will perform the FNC4-based extended character encoding for you, as in the example below. The majority don't but these should allow you to specify an FNC4 character directly so that you can manually drive the process using the above technique, e.g: Qui{FNC4}Qones

The Code 128 symbol looks like this:

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

Barcode:  Code 128
Contents: Qui^209ones
Options:  parse height=0.5
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!