简体   繁体   English

ISO8583-AlphaNumeric字段类型的数字部分的编码方法

[英]ISO8583 - Encoding method for the Numeric part of the AlphaNumeric field type

Should I use BCD encoding for the numeric part in the Alphanumeric field while the message encoding is BCD instead of ASCII? 当消息编码是BCD而不是ASCII时,是否应该对字母数字字段中的数字部分使用BCD编码?
For example, should I encode "12AB" to x31 x32 x41 x42 (all ASCII) or x12 x41 x42 (BCD and ASCII) ? 例如,我应该将“ 12AB”编码为x31 x32 x41 x42(所有ASCII)还是x12 x41 x42(BCD和ASCII)? and if it's former, then what's the purpose of Alphanumeric? 如果是以前的话,字母数字的目的是什么? Why not just use Alpha? 为什么不只使用Alpha?

BCD encoding used usually for numeric-only fields like amounts, dates, sometimes Track2 where D used as separator and feet BCD encoding. BCD编码通常用于仅数字字段(例如金额,日期),有时用于Track2(其中D用作分隔符)和英尺BCD编码。 Alphanumeric fields stay in ASCII. 字母数字字段保留为ASCII。

And even if your message specification force to use BCD for the alphanumeric fields it is expected to use half of byte (nibble) for each ASCII character. 即使您的消息规范强制将BCD用于字母数字字段,对于每个ASCII字符也应使用一半字节(半字节)。 Then the supported letters could be only A,B,C,D,E or F. 那么支持的字母只能是A,B,C,D,E或F。

For you example "12AB" ASCII expected to be BCD encoded as 0x12 0xAB . 对于您的示例,“ 12AB” ASCII预期将BCD编码为0x12 0xAB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM