tfgm / sbedecoder

Python based Simple Binary Encoding (SBE) decoder
MIT License
76 stars 44 forks source link

Fix for string types with semanticType != 'String' #17

Closed tamboril closed 7 years ago

tamboril commented 7 years ago

With 'SecurityExchange' as an example, the unpack_fmt was being computed as '<4c', and what should've been 'XCME' came out as 'X'.  It seems that python doesn't interpret the length before the 'c'; so it's the same as '<c' (the endian is superfluous).

I put in a fix for type 'char' fields with length > 1 to have a unpack_fmt of (e.g.) '4s' (no endian, either).