by Chris » Fri Nov 04, 2022 8:09 pm
Note that "visible characters" becomes murky when dealing with Unicode, as there are plenty of characters that are used to alter other characters (adding diacritics, change rendering direction, etc). With UTF-8, some characters may span 2, 3, or 4 bytes. Simply counting the number of bytes and ignoring the color codes won't result in the number of printed characters.
Note that "visible characters" becomes murky when dealing with Unicode, as there are plenty of characters that are used to alter other characters (adding diacritics, change rendering direction, etc). With UTF-8, some characters may span 2, 3, or 4 bytes. Simply counting the number of bytes and ignoring the color codes won't result in the number of printed characters.