by silvestrov · 1d ago · 0 comments
E.g. in Java a char is 16 bit while strings are encoded as 8 bit or 16 bit. (If the string only contains Latin1 chars, it will use 8 bit encoding to save memory).
The char type should be what you use while looking at a single decoded character (e.g. when parsing text files), not how you encode it in a string.