Go Strings
Contents
Unicode
A string is an immutable container of uint8 bytes. They are meant to represent text encoded in UTF-8, but not every byte is guaranteed to be valid Unicode.
There are only a few instances where strings are implicitly encoded:
in for i, r := range s, the r is a Unicode rune
in rs := []rune(s), rs is a string of Unicode runes
In these cases, all invalid Unicode bytes are converted to U+FFFD (the replacement character).