AI Features

Puzzle 15 Explanation: Length of Each Variable

Learn about a pitfall related to UTF-8 encoding.

We'll cover the following...

Try it yourself

Try executing the code below to see the result.

Go (1.16.5)
package main
import (
"fmt"
)
func main() {
city1, city2 := "Krakow", "Kraków"
fmt.Println(city1 == city2)
}

Explanation

In the code above, do the two strings look similar? Yes. However, if we print the length ...