On Thursday, 6 February 2014 at 22:20:38 UTC, Dicebot wrote:
On Thursday, 6 February 2014 at 22:18:10 UTC, Brad Anderson wrote:
You should probably validate utf from all foreign sources. Catch a problem with it as it comes in rather than in some arbitrary part of your program.

http://dlang.org/phobos/std_utf.html#.validate

pure @safe void validate(S)(in S str) if (isSomeString!S);

Throws:
UTFException if str is not well-formed.

And somewhere in the world, darkness fell forever on a bright and beautiful countryside. The monsters poured forth and devoured everything in sight, given strength by that unbelievable abomination of a function design.

Reply via email to