Re: [PATCH] lib/ucs2_string: Correct ucs2 -> utf8 conversion

2016-02-15 Thread Laszlo Ersek
On 02/15/16 12:12, Matt Fleming wrote: > (Cc'ing Laszlo and linux-efi) > > On Fri, 12 Feb, at 11:13:33PM, Jason Andryuk wrote: >> The comparisons should be >= since 0x800 and 0x80 require an additional bit >> to store. >> >> For the 3 byte case, the existing shift would drop off 2 more bits than >

Re: [PATCH] lib/ucs2_string: Correct ucs2 -> utf8 conversion

2016-02-15 Thread Matt Fleming
(Cc'ing Laszlo and linux-efi) On Fri, 12 Feb, at 11:13:33PM, Jason Andryuk wrote: > The comparisons should be >= since 0x800 and 0x80 require an additional bit > to store. > > For the 3 byte case, the existing shift would drop off 2 more bits than > intended. > > For the 2 byte case, there shoul

[PATCH] lib/ucs2_string: Correct ucs2 -> utf8 conversion

2016-02-12 Thread Jason Andryuk
The comparisons should be >= since 0x800 and 0x80 require an additional bit to store. For the 3 byte case, the existing shift would drop off 2 more bits than intended. For the 2 byte case, there should be 5 bits bits in byte 1, and 6 bits in byte 2. Signed-off-by: Jason Andryuk --- Tested in u