zotonic/zotonic — pull request #439 by Motiejus (2012-10-05 17:08:03+00:00)
Title: FIX z_string:s_utf8/2

Current checker does not validate that codepoints are within allowed
range. For instance, this encodes U-00000, but passes the current
validator: `<<2#110:3, 0:5, 2#10:2, 0:6>>`. (`<<16#C080>>`).

New checker takes into account both utf8 syntax and allowed values that
certain length codepoints can encode.

Background: I was looking for an Erlang utf-8 validator and generator for a bigger project and came across this one. Validator was wrong, so I fixed it. Since there is also a PropEr generator and PropEr test suite, it has a separate repository:
https://github.com/Motiejus/z_string