torvalds / uemacs

Random version of microemacs with my private modificatons
1.21k stars 234 forks source link

The function unicode_to_utf8 may contain a bug #15

Closed rvillalob closed 6 years ago

rvillalob commented 6 years ago

I may be mistaken, but I think the function unicode_to_utf8 is broken. Although it is able to generate the continuation bytes of the UTF8 sequence, it fails to produce the correct leading byte.

rvillalob commented 6 years ago

I was wrong the first time. The reason the function doesn't work is because the loop's test condition should be c >= prefix instead of c > prefix

rfivet commented 6 years ago

You are right. (see https://github.com/rfivet/cigue/commit/2cef0714926cc119c57b096fab3cf70520ff21c5)