unidecode icon indicating copy to clipboard operation
unidecode copied to clipboard

Code panics for Unicode U+10000

Open tja opened this issue 4 years ago • 0 comments

Decoding a string with a unicode rune of U+10000 — 𐀀 — results in a panic. The reason is line 45 in unidecode.go, which allows the aforementioned unicode character to slip through..

if c > unicode.MaxRune || c > transCount {

..causing an "index out of range" error in line 49. Changing this to..

if c > unicode.MaxRune || c >= transCount {

..fixes the problem.

tja avatar Mar 10 '21 15:03 tja