Task
Given a UTF-8 string (by any means) answer (by any means) an equivalent list where every element is the number of bytes used to encode the corresponding input character.
Examples
!
→ 1
Ciao
→ 1 1 1 1
tʃaʊ
→ 1 2 1 2
Adám
→ 1 1 2 1
ĉaŭ
→ 2 1 2
(single characters)
ĉaŭ
→ 1 2 1 1 2
(uses combining overlays)
チャオ
→ 3 3 3
(empty input) →
(empty output)
!±≡𩸽
→ 1 2 3 4
(a null byte) → 1
Null bytes
If the only way to keep reading input beyond null bytes is by knowing the total byte count, you may get the byte count by any means (even user input).
If your language cannot handle null bytes at all, you may assume the input does not contain nulls.