bwip.js: 如何在GS1-128中使用分组分隔符字符

huangapple go评论69阅读模式
英文:

bwip.js: How to use the Group Separator character with GS1-128

问题

以下是您要翻译的内容:

There is a service hosted on for generating barcodes metafloor.com using bwip.js
I want to generate a barcode for the following data (GS character is represented by {GS}).

According to the documentation, I'm able to generate a barcode for data without the GS character:

But the scanner requires GS characters.

The documentation is clear:

  1. Special characters must be encoded in the format ^NNN.
  2. Parse option has to be true, by using the parsefnc parameter.
  3. The parameter has to be URL-encoded.

So for my string:

But this gives me Error: bwipp.GS1badCSET82character: AI 10: Invalid CSET 82 character.

I also tried:

  1. Send GS char directly as %1D.
  2. Send GS char as %5EGS.
  3. Send GS char as ^029.
  4. Send GS char directly.
  5. Set parsefnc=true.
  6. A combination of all the above.

But I'm still getting the same error. Is there something I'm doing wrong, or is the problem on the other side?

英文:

There is a service hosted on for generating barcodes metafloor.com using bwip.js
I want to generate a barcode for following data (GS character is represent by {GS}).

(01)10875066000333(10)1212{GS}(17)121212(30)8{GS}

According the documentation I'm able to generate a barcode for data without GS character

https://bwipjs-api.metafloor.com/?bcid=gs1-128&text=(01)10875066000333(10)1212(17)121212(30)8

But the scanner require GS characters.

The documentation is clear

  1. Special characters must be encoded in format ^NNN
  2. Parse option has to be true, by using parsefnc parameter
  3. The parameter has to be URL-encoded.

So for my string it's:

https://bwipjs-api.metafloor.com/?bcid=gs1-128&text=(01)10875066000333(10)1212%5E029(17)121212(30)8%5E029&parsefnc

But this gives me Error: bwipp.GS1badCSET82character: AI 10: Invalid CSET 82 character.
I also tried

  1. Send GS char directly as %1D
  2. Send GS char as %5EGS
  3. Send GS char as ^029
  4. Send GS char directly
  5. Set parsefnc=true
  6. Combination of all above

But still getting the same error.

Is there something I'm doing wrong or is the problem on the other side?

答案1

得分: 1

对于基于GS1应用标识符的数据,请相信库会通过选择符号系统的GS1特定编码器(在这种情况下是gs1datamatrix)来正确编码数据,然后以括号AI表示法提供输入,即没有FNC1 / GS分隔符。

编码器将自动添加所有必需的FNC1非数据字符(当被扫描仪读取时将作为ASCII GS字符传输),它还将验证您提供的AI数据内容。

选择通用符号系统然后尝试自行执行AI编码的用户很容易犯下多个错误:

  • 省略第一个位置所需的FNC1。
  • 在没有预定宽度的AI末尾省略所需的FNC1分隔符。
  • 用不必要的FNC1字符终止预定义长度的AI。
  • 用不必要的FNC1字符终止消息。
  • 编码ASCII GS数据字符而不是规范的FNC1非数据字符。
  • 包括非法的文字括号来表示AI。
  • 提供格式不正确或无效的AI值。
  • 省略必需的AI属性。
  • 包含互斥的AI配对。

许多这些错误将导致无法解码和解释GS1 AI数据(即使条形码看起来成功读取),这可能导致退款并需要重新贴标签或处置物品。

您提供的数据至少涉及其中一些错误。

参见此文章,详细描述了BWIPP(因此也包括BWIP-JS)实施以防止此类数据质量问题。

英文:

For GS1 Application Identifier based data, trust the library to encode the data correctly by selecting the GS1-specific encoder for the symbology (gs1datamatrix in this case) and then provide the input in bracketed AI notation, i.e. without FNC1 / GS separators.

The encoder will automatically add all of the necessary FNC1 non-data characters (which are transmitted as ASCII GS characters when read by a scanner) and it will also validate the contents of the AI data that you supply.

Users that select a generic symbology and then attempt to perform the AI encoding themselves are prone to making several mistakes:

  • Omitting the required FNC1 in first position.
  • Omitting the required FNC1 separators at the end of AIs with no pre-determined width.
  • Terminating pre-defined length AIs with unnecessary FNC1 characters.
  • Terminating the message with an unnecessary FNC1 character.
  • Encoding ASCII GS data characters instead of the canonical FNC1 non-data characters.
  • Including illegal, literal parentheses to denote the AIs.
  • Providing improperly formatted or invalid AI values.
  • Omitting requisite AI attributes.
  • Including mutually-exclusive AI pairings.

Many of these mistakes will result in failure to decode and interpret the GS1 AI data (even if the barcode appears to read successfully) which may result in charge-backs and necessitate relabelling or disposal.

The data that you are providing falls afoul of at least some of these pitfalls.

See this article for a thorough description of the checks that BWIPP (and hence BWIP-JS) implements to prevent such data quality issues.

huangapple
  • 本文由 发表于 2023年2月6日 21:06:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/75361706.html
  • barcode
  • bwip-js
  • gs1-128
  • gs1-ai-syntax
  • gs1-datamatrix
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定