ECCC-MSC / libecbufr

libecbufr is a general purpose, template-oriented BUFR encoding/decoding library
Other
10 stars 7 forks source link

ambiguity between binary and integer for flagtable's value datafile loading #49

Open vsouvan opened 4 years ago

vsouvan commented 4 years ago

When loading a datafile, the string representing a value for a flagtable can either be in binary form or integer. There is a problem if the integer form is used, and the integer value only have 1 and 0 in it. Which will be considered as a binary and read as a binary which is wrong. Example: 1101 is loaded as 13 instead.

The workaround is avoid using integer as value for FLAGTABLE in datafile. And only use values in binary form.


Imported from Launchpad using lp2gh.

vsouvan commented 4 years ago

(by chris-beauregard) Could also default to binary, but allow a syntax like:

i1101 b01001 o544 x7f

which unambiguously specifies the flag type. The hex representation, in particular, might be useful.

vsouvan commented 4 years ago

(by yves-pelletier) I like Chris' suggestion.