Closed kengruven closed 3 years ago
Good catch! Added https://github.com/kstenerud/concise-encoding/commit/1c775f463c14bf940f9f2da64459b430750c7192 and also the reference implementation, go-compact-time, and enctool are updated.
I've confirmed that it now works for len=127, and aborts for len=128. Thanks.
The CE/CTE specs don't say anything about a length limit on a time zone name. In CBE ("Compact Time"), the length field is 7 bits wide, so you get a max of 127 bytes of (UTF-8, I assume) character data.
Right now, if you provide a longer TZ string, enctool is happy to parse it and re-encode it in CBE, but this creates an invalid document that it can't parse:
Since this is a fixed-width field in CBE, I think CE should declare that TZ strings can't be longer than 127 bytes (and libraries should enforce that).