>
> The UTF8 encoding of that codepoint is three bytes.  So the rune will 
> still occupy 4 bytes, even if the last byte holds no data? 
>

A rune has nothing to do with UTF-8.
A rune stores the codepoint which is totally independent
of any encoding (like UTF-8, UTF-16, UTF-23, EBCDIC, whatnot).

A rune is an integer, the number of the codepoint.
An integer is stored in a certain number of bytes.
Asking  "So the rune will still occupy 4 bytes, even if the last
byte holds no data?" is like asking "So the number 12 will
still occupy 8 bits, even if the last 5 bits hold no data?".
Yes. An integer is stored in 8 bytes (64bit architecture)
and this is true even for "small" integers which would "fit"
into one byte.

A rune is an integer. It has nothing to do with UTF.

V.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to