3 ms·
While UTF-8 is a good default encoding, it seems odd to tie standard functions into things which cannot be presumed. Without having the ability to specify encod
by jpd 17y ago
While UTF-8 is a good default encoding, it seems odd to tie standard functions into things which cannot be presumed. Without having the ability to specify encoding, you will have one function for UTF-8 and a different one (roll your own?) for every other encoding out there.
Uhm... read the both these lines, not just one of them like you did before:
<jnthn> chars($string) # characters
<jnthn> bytes($string) # how many bytes
- trezor 17y agoI guess you should reread my comment. I'm fully aware of that you can get chars with chars(), but that's not what I'm pointing out. If you are going to have a function for the size a "rendered" unicode string and there are 200+ ways to render it, it seems odd to tie a function to one and only of those ways, giving you one function for one encoding, and another one for all the other ones.