Merge: UTF-8 byte reading error
authorJean Privat <jean@pryen.org>
Fri, 7 Aug 2015 15:38:26 +0000 (11:38 -0400)
committerJean Privat <jean@pryen.org>
Fri, 7 Aug 2015 15:38:26 +0000 (11:38 -0400)
commit1282951ae2bd82e3e9dcce44f13a76a00cf2825f
tree8df43323ae977cb56742a286e195cd57764a2cc0
parent06cef8ab529c01ce18a5c14fd9a94b76db18b87b
parentda0d086061ece085ca939657a4d05add9cf83d02
Merge: UTF-8 byte reading error

A small bug in char_at and length_of_char_at found their way and up until now did not pose any problem, however on some borderline cases (such as the 0x10FFFF example below) the char was misread as 0xFFFD.

The standard specifies the first byte of a 4 byte sequence to start with a `0b1111_0xxx` form, that the masks used in these methods did not check properly.

Pull-Request: #1617
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>