Julia 0.6.0-rc1.0 can’t properly load a Unicode character in a settings file I have, specifically “³” (U+00b3). Julia doesn’t have a problem if it’s a UTF-8 Unicode file but the settings files we have are generated in ISO-8859 format.
Julia 0.6 does load the line but the character that should be a ³ shows up as a symbol with a question mark in it (see below). Using readline
to load the line returns a 30-byte String of invalid UTF-8 data
.
Specific Problem Line
CO2, 10 , 40 , mmol/m³ , 0 , E
Error Message:
CO2, 10 , 40 , mmol/m� , 0 , E
ERROR: LoadError: at row 1, column 3 : UnicodeError: invalid character index)
Stacktrace:
[1] dlm_parse(::String, ::Char, ::Char, ::Char, ::Char, ::Bool, ::Bool, ::Bool, ::Int64, ::Bool, ::Base.DataFmt.DLMOffsets) at ./datafmt.jl:610
[2] readdlm_string(::String, ::Char, ::Type, ::Char, ::Bool, ::Dict{Symbol,Union{Char, Integer, Tuple{Integer,Integer}}}) at ./datafmt.jl:343
[3] readdlm_auto(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Char, ::Type{T} where T, ::Char, ::Bool) at ./datafmt.jl:119
[4] #readdlm#7 at ./datafmt.jl:81 [inlined]
[5] readdlm(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Char, ::Char) at ./datafmt.jl:81
[6] #readdlm#6 at ./datafmt.jl:73 [inlined]
[7] readdlm(::Base.AbstractIOBuffer{Array{UInt8,1}}, ::Char) at ./datafmt.jl:73
[8] #readcsv#14 at ./datafmt.jl:618 [inlined]
[9] readcsv(::Base.AbstractIOBuffer{Array{UInt8,1}}) at ./datafmt.jl:618
[10] slt_configload(::Array{String,1}) at /home/user/.julia/v0.6/MyModule/src/slt_configload.jl:67
[11] slt_config(::Array{String,1}) at /home/user/.julia/v0.6/MyModule/src/slt_config.jl:28
[12] #slt_load#21(::Bool, ::Bool, ::Float64, ::Function, ::String, ::DateTime, ::DateTime) at /home/user/.julia/v0.6/MyModule/src/slt_load.jl:115
[13] (::MyModule.#kw##slt_load)(::Array{Any,1}, ::MyModule.#slt_load, ::String, ::DateTime, ::DateTime) at ./:0
[14] include_from_node1(::String) at ./loading.jl:552
[15] include(::String) at ./sysimg.jl:14
[16] process_options(::Base.JLOptions) at ./client.jl:305
[17] _start() at ./client.jl:371
while loading /home/user/.julia/v0.6/MyModule/test/runtests.jl, in expression starting on line 11
Julia 0.5 didn’t have this problem.
Is there a setting I’ve missed that will allow Julia to parse it properly?