diff --git a/Sources/bumblebee.swift b/Sources/bumblebee.swift index 1234e08..eda9698 100644 --- a/Sources/bumblebee.swift +++ b/Sources/bumblebee.swift @@ -86,8 +86,8 @@ open class Parser { if location == NSNotFound { continue } - let start = mutText.index(mutText.startIndex, offsetBy: range.location) - let end = mutText.index(mutText.startIndex, offsetBy: range.location + range.length) + let start = mutText.utf16.index(mutText.startIndex, offsetBy: range.location) + let end = mutText.utf16.index(mutText.startIndex, offsetBy: range.location + range.length) if let str = String(mutText.utf16[start..