mozilla/rust — pull request #5151 by thestinger (2013-02-27 21:58:23+00:00)
Title: str: stop encoding invalid code points

The highest valid code point is 1114111 (0x10FFFF) and the modern UTF-8
standard guarantees that the maximum number of bytes needed to encode a
code point is 4 (instead of 6, in the legacy standard).

From :

Changes from RFC 2279

o Restricted the range of characters to 0000-10FFFF (the UTF-16
accessible range).