fmt: unify and align wording regarding characters, digits, and bytes
Contribution description
The current wording of the fmt module may be a bit confusing (see https://github.com/RIOT-OS/RIOT/pull/18310). This PR aims to fix that.
Testing procedure
Read.
Issues/PRs references
Alternative to https://github.com/RIOT-OS/RIOT/pull/18310
Can we postpone this until I'm back from holidays? No time to argue now :) I find using "characters" utterly confusing. We're in total "one byte has eight bits" land, and so, fmt writes bytes to buffers. (It maybe prints characters).
I find using "characters" utterly confusing. We're in total "one byte has eight bits" land, and so, fmt writes bytes to buffers.
Mh... the type of all out parameters for which I changed to "characters" are of type char *. Typically, in C this is a string (of characters) not a buffer (of bytes) so I do not understand your argument.
Can we postpone this until I'm back from holidays? No time to argue now :)
Sure!
Huh what's confusing about using characters for string output? I wouldn't have expected this to be controversial.
Huh what's confusing about using characters for string output?
because characters nowadays often mean multi-byte characters. 'Į' is a character. When talking about how much data is written to a byte buffer, numbering "bytes" is just more precise.
because characters nowadays often mean multi-byte characters. 'Į' is a character. When talking about how much data is written to a byte buffer, numbering "bytes" is just more precise.
But that's not how these functions work. They provide char as an output/input, not 8-bit wide units, commonly called bytes (which is uint8_t in C). The width of char is platform dependent (though it is commonly understood it is also 8-bit ASCII characters). What you are talking about is UTF-8 characters, but those are a completely different type in C. Lastly, since this is about converting between bytes and their string representation, sticking to "bytes" for both input and output is confusing.
ok