Need Help with accented characters

There probably is a better way. What you read is a sequence of bytes interpreted as UTF-8. That’s what a String is. So you need to decode it. But to do that the function decode in StringEncodings needs a byte buffer, that is Vector{UInt8}.

To convert a single string, the following works:

julia> using StringEncodings

julia> s
"avi\xe3o"

julia> decode(Vector{UInt8}(s), "ISO-8859-1")
"avião"


1 Like