mozillazg / go-unidecode

ASCII transliterations of Unicode text.
https://godoc.org/github.com/mozillazg/go-unidecode
MIT License
130 stars 19 forks source link

Why adding space in the last? #8

Open ghost opened 1 year ago

ghost commented 1 year ago
assert.Equal(t, "Ni Hao", unidecode.Unidecode("你好"))

return:

            Error:          Not equal: 
                            expected: "Ni Hao"
                            actual  : "Ni Hao "

it would be better if this returns just "Ni Hao".

glaslos commented 1 year ago

Seems like this is how the table is defined to get the spacing: https://github.com/mozillazg/go-unidecode/blob/d21c69a0839f8f4647f6d580208c0a0219f5c2a3/table/x056.go#L3

ivanjaros commented 1 year ago

the bei jing, 北京, from examples is the same, with trailing space