Hi,

I'm trying to find an example where strings.EqualFold returns true but 
comparison of strings.ToLower fails.
I've found this example 
<https://www.programiz.com/python-programming/methods/string/casefold> (in 
Python):

s1 = "der Fluß"
s2 = "der Fluss"

print('lower', s1.lower() == s2.lower())
print('fold ', s1.casefold() == s2.casefold())

Which prints False for lower and True for casefold.

When I try the same in Go
package main

import (
"fmt"
"strings"
)

func main() {

s1 := "der Fluß"
s2 := "der Fluss"

fmt.Println("lower", strings.ToLower(s1) == strings.ToLower(s2))
fmt.Println("fold ", strings.EqualFold(s1, s2))
}

I get false for both ToLower and EqualFold.

Shouldn't Unicode folding be the same across languages?
Also, does anyone have an example I can show in Go where ToLower does not 
compare and EqualFold does?

Thanks,
Miki

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c61bcb93-aa76-4b8c-ae69-7bcbf0c7567c%40googlegroups.com.

Reply via email to