Re: [CODEC] how to handle invalid encode/decode input?

2017-03-28 Thread Gary Gregory
Hi Sebb, If I were to do this from scratch I would make each codec object instance-based and constructed from a factory with a "validating" flag. So you'd get a validating or non-validating codec; kind of like an XML parser can validate against a schema or not. This might be too much for a minor

[CODEC] how to handle invalid encode/decode input?

2017-03-26 Thread sebb
Various Codec methods need to encode and decode bytes/Strings. Not all byte sequences can be decoded into Strings, and not all Strings can be encoded into bytes. So a decision has to be made as to what to do when an invalid sequence is detected. At present the encoding/decoding is done by the