iso8583 icon indicating copy to clipboard operation
iso8583 copied to clipboard

Garbage printed when Describing field with binary encoding

Open lnbotur opened this issue 4 years ago • 0 comments

Hi, In describe, the values of binary coded fields are not converted to hexadecimal. Proposed fix in describe.go: ... field := fields[i] desc := field.Spec().Description var str string if field.Spec().Enc == encoding.Binary { b, err := field.Bytes() if err != nil { errorList = append(errorList, err.Error()) continue } str = strings.ToUpper(hex.EncodeToString(b)) } else { str, err = field.String() if err != nil { errorList = append(errorList, err.Error()) continue } } fmt.Fprintf(tw, fmt.Sprintf("F%03d %s\t: %%s\n", i, desc), str) ... Regards

lnbotur avatar Oct 15 '21 12:10 lnbotur