I have a file format that returns bytes in EBCDIC format:
3200-element Array{UInt8,1}:
0xc3
0x40
0xf1
0x40
0xc3
0xd3
0xc9
0xc5
0xd5
0xe3
0x7a
0x40
0xc2
⋮
0x40
0x40
0x40
0x40
0x40
0x40
0x40
0x40
0x40
0x40
0x40
0x40
When I copy the bytes before … into an online converter with EBCDIC 0037 formatting, I get the correct value:
Bytes: x" 0XC3 0X40 0XF1 0X40 0XC3 0XD3 0XC9 0XC5 0XD5 0XE3 0X7A 0X40 0XC2 "
ASCII String: Ã@ñ@ÃÓÉÅÕãz@Â
EBCDIC String: C 1 CLIENT: B
I’m trying to do the same within Julia using the StringEncodings.jl package, but getting an error:
decode(ebcdic_array, "EBCDIC-US")
Conversion from EBCDIC-US to UTF-8 not supported by iconv implementation, check that specified encodings are correct
Stacktrace:
[1] iconv_open(::String, ::String) at /home/rzwitch/.julia/packages/StringEncodings/ICuGB/src/StringEncodings.jl:88
[2] StringDecoder(::Base.GenericIOBuffer{Array{UInt8,1}}, ::Encoding{Symbol("EBCDIC-US")}, ::Encoding{Symbol("UTF-8")}) at /home/rzwitch/.julia/packages/StringEncodings/ICuGB/src/StringEncodings.jl:286
[3] decode(::Type{String}, ::Array{UInt8,1}, ::Encoding{Symbol("EBCDIC-US")}) at /home/rzwitch/.julia/packages/StringEncodings/ICuGB/src/StringEncodings.jl:474
[4] decode(::Array{UInt8,1}, ::String) at /home/rzwitch/.julia/packages/StringEncodings/ICuGB/src/StringEncodings.jl:483
[5] top-level scope at In[70]:100
Am I missing an intermediate step?
EDIT: Julia 1.1, StringEncodings 0.3.1