Added unicode support
Replaced strings with rune-slices, which capture unicode codepoints more accurately.
This commit is contained in:
2
misc.go
2
misc.go
@@ -22,7 +22,7 @@ func dotChars() []rune { // Returns all possible characters represented by the d
|
||||
}
|
||||
|
||||
// Returns true if str[idx] and str[idx-1] are separated by a word boundary.
|
||||
func isWordBoundary(str string, idx int) bool {
|
||||
func isWordBoundary(str []rune, idx int) bool {
|
||||
str_runes := []rune(str)
|
||||
wbounded := idx == 0 ||
|
||||
idx >= len(str) ||
|
||||
|
Reference in New Issue
Block a user