You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the String constructor with an Array{UInt8} as an argument seems to construct the string by interpreting the array's content as ASCII or UTF-8. It is not clear to me whether this is by design - other languages such as Python would never allow this without an explicit specification of the desired encoding.
What is surprising, however, is that the array's contents disappear in the process. This is certainly not intuitive and probably not intended.
julia> a = [0x30, 0x31]
2-element Array{UInt8,1}:0x300x31
julia>String(a)
"01"
julia> a
0-element Array{UInt8,1}
Using Julia version 1.3.1 (2019-12-30)
The text was updated successfully, but these errors were encountered:
Using the String constructor with an Array{UInt8} as an argument seems to construct the string by interpreting the array's content as ASCII or UTF-8. It is not clear to me whether this is by design - other languages such as Python would never allow this without an explicit specification of the desired encoding.
What is surprising, however, is that the array's contents disappear in the process. This is certainly not intuitive and probably not intended.
Using Julia version 1.3.1 (2019-12-30)
The text was updated successfully, but these errors were encountered: