]> Kevux Git Server - fll/commit
Update: Experimentall cast characters to uint8_t in UTF-8 processing code.
authorKevin Day <thekevinday@gmail.com>
Tue, 9 Nov 2021 02:36:22 +0000 (20:36 -0600)
committerKevin Day <thekevinday@gmail.com>
Tue, 9 Nov 2021 02:39:35 +0000 (20:39 -0600)
commit8a78b401da8275492c69096bff53a3fcb6470587
tree65bc4555fb069347088c7ed12a1b2daecc2ace8f
parent6fb1fa00176bc43d2fb413e77357bddf006a9154
Update: Experimentall cast characters to uint8_t in UTF-8 processing code.

I've noticed with calls like printf("%d", string[0]) the printed number might be a negative huge number.
Explicitly casting it to uint8_t (rather than char) seems to be a way to avoid this and allow for the number to be better printed.
I am suspecting that this should be done in general rather than just to the print functions.
This is an experimental commit designed to make it so.

This also has an affect on bitwise operations because bitwise shifts respond differently between signed and unsigned integers.
level_0/f_utf/c/utf.c