[Issue 14919] utf/unicode should only be validated once

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Aug 13 23:58:26 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=14919

--- Comment #2 from Martin Nowak <code at dawg.eu> ---
Such text protocols don't randomly contain binary data.
It's properly delimited either by text markers or by known offsets.
So what you need to do, is to lazily validate and convert ubyte[] to ASCII/UTF,
find the delimiters (could prolly be done on ubyte[]), and skip validation for
the binary blob.
Vice versa for binary protocols that contain strings, first work on the binary
data and then validate the extracted strings.

--


More information about the Digitalmars-d-bugs mailing list