3 ms·
> The close second being 17, because length in bytes. Is another fine way to represent this data, e.g. what a successful write of some sort would look like. Net
by globular-toast 3y ago
> The close second being 17, because length in bytes. Is another fine way to represent this data, e.g. what a successful write of some sort would look like. Network or file.
Almost. 17 is the number of bytes it occupies in memory. But you don't generally dump memory directly to disk or network. It happens to make sense (and it's convenient) for utf8 strings. But it's better to be explicit about that. Python is better. If you care about bytes, say you care about bytes:
len(bytes(" ", "utf8")) == 17
len(bytes(" ", "utf-16-be")) == 14
len(bytes(" ", "utf-32-be")) == 20