package main
import (
"fmt"
)
func printBytes(s string) {
for i:= 0; i < len(s); iPP {
fmt.Printf("%x ", s[i])
}
}
func printChars(s string) {
runes := []rune(s)
for i:= 0; i < len(runes); iPP {
fmt.Printf("%c ",runes[i])
}
}
func main() {
runeSlice := []rune{0x0053, 0x0065, 0x00f1, 0x006f, 0x0072}
str := string(runeSlice)
fmt.Println(str)
name := "Seor"
printBytes(name)
fmt.Printf("\n")
printChars(name)
}
output
Se or
53 65 c3 b1 6f 72 / / 5 characters are divided into 6
Se or