diff --git a/base/utf8.jl b/base/utf8.jl index dabea3ab98529..387b3200a598d 100644 --- a/base/utf8.jl +++ b/base/utf8.jl @@ -135,7 +135,7 @@ function search(s::UTF8String, c::Char, i::Integer) throw(BoundsError(s, i)) end d = s.data - if !is_utf8_start(d[i]) + if is_valid_continuation(d[i]) throw(UnicodeError(UTF_ERR_INVALID_INDEX, i, d[i])) end c < Char(0x80) && return search(d, c%UInt8, i)