Android Code 128 条码的最大长度

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24263237/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 07:57:02  来源:igfitidea点击:

Maximum length of a Code 128 barcode

androidbarcodezbar-sdk

提问by Divya

I need to create a Code 128 barcode with a maximum of 44 characters. What is the maximum number of characters supported by the Code 128 barcode format?

我需要创建一个最多 44 个字符的 Code 128 条码。Code 128 条码格式支持的最大字符数是多少?

I came to know that Code 128 can encode all 128 characters of ASCII, but I cannot determine the maximum number of characters it supports.

我开始知道 Code 128 可以编码 ASCII 的所有 128 个字符,但我无法确定它支持的最大字符数。

回答by Terry Burton

The specification for Code 128 (ISO/IEC 15417) leaves the maximum length undefined and states that this is something that should be defined by any derivative application[*]standard:

Code 128 (ISO/IEC 15417) 规范未定义最大长度,并指出这是任何衍生应用程序[*]标准都应定义的内容:

4.7.1 Symbology and data characteristics

Application specifications should consider the following parameters.

b) The number of data characters in the symbol, which may be fixed, variable or variable up to a defined maximum.

4.7.1 符号和数据特征

应用规范应考虑以下参数。

b) 符号中的数据字符数,它可以是固定的、可变的或可变的,直到定义的最大值。

For example the GS1 General Specification define that GS1-128 (the formal application of Code 128 to the supply chain industry) has a limits of 48 characters per symbol:

例如,GS1 通用规范定义 GS1-128(Code 128 在供应链行业的正式应用)每个符号的限制为 48 个字符:

5.4.1 GS1-128 Bar Code Symbol size characteristics:

The characteristics of the GS1-128 Symbology are:

  • GS1-128 Bar Code Symbol size characteristics:

    • The maximum number of data characters in a single symbol is 48.

5.4.1 GS1-128 条码符号尺寸特性:

GS1-128 符号体系的特点是:

  • GS1-128条码符号尺寸特性:

    • 单个符号中的最大数据字符数为 48。

Practically one should restrict the number of characters to whatever fits comfortably in a scanner's field of view. This will vary depending on the type and model of the device, e.g. handheld vs fixed, laser vs CCD, high-end vs budget, etc. In uncontrolled or open environments a high degree of tolerance should be budgeted for.

实际上,应该将字符数限制为适合扫描仪视野的任何字符数。这将根据设备的类型和型号而有所不同,例如手持与固定、激光与 CCD、高端与预算等。在不受控制或开放的环境中,应为高度的容忍度做预算。

It is especially worth noting that Code 128 supports double-density compression of numeric data ("mode C") which makes encoding long strings of digits much more efficient.

尤其值得注意的是,Code 128 支持数字数据的双密度压缩(“模式 C”),这使得对长数字字符串的编码效率更高。

Here is a 44-digit Code 128 containing 12345678901234567890123456789012345678901234:

这是一个 44 位代码 128,其中包含12345678901234567890123456789012345678901234

44-digit Code 128

44 位代码 128

This is appropriately sized for most practical applications.

对于大多数实际应用,这是适当的大小。

However, here is the same Code 128 this time containing 44 alpha characters ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCD:

但是,这次是相同的 Code 128,包含 44 个字母字符ABCDEFGHIJABCDEFGHIJABCDEFGHIJABCDEFGHIJABCD

44-alpha character Code 128

44 个字母字符代码 128

A barcode of this size will not be useful in as many applications since reading this reliably would require a scanner with a high resolution and wide field-of-view.

这种尺寸的条码在许多应用中都没有用处,因为要可靠地读取它需要具有高分辨率和宽视野的扫描仪。

So ultimately the maximum length of a Code 128 is dependant not only on the practical constraints of the application but also the type of data to be encoded.

因此,最终 Code 128 的最大长度不仅取决于应用程序的实际约束,还取决于要编码的数据类型。

[*] Application is the industry term referring to the environment and processes in which the barcode system is to be used, rather than any specific software application.

[*] 应用程序是行业术语,指的是使用条码系统的环境和过程,而不是任何特定的软件应用程序。