diff --git a/base/utf8.jl b/base/utf8.jl index 7b30ac0f37e07..7986dff9285ea 100644 --- a/base/utf8.jl +++ b/base/utf8.jl @@ -220,12 +220,8 @@ convert(::Type{UTF8String}, s::ASCIIString) = UTF8String(s.data) " Converts a UTF-8 encoded vector of `UInt8` to a `UTF8String` -### Input Arguments: -* `::Type{UTF8String}` -* `dat::Vector{UInt8}` - ### Returns: -* `::UTF8String` +* `UTF8String` ### Throws: * `UnicodeError` @@ -234,7 +230,7 @@ function convert(::Type{UTF8String}, dat::Vector{UInt8}) # handle zero length string quickly isempty(dat) && return empty_utf8 # get number of bytes to allocate - len, flags, num4byte, num3byte, num2byte = check_string(dat) + len, flags, num4byte, num3byte, num2byte = unsafe_checkstring(dat) if (flags & (UTF_LONG | UTF_SURROGATE)) == 0 len = sizeof(dat) @inbounds return UTF8String(copy!(Vector{UInt8}(len), 1, dat, 1, len))