Hi all,
I want to download a file and unzip the only file in the archive to feed a CSV.File (Energy data for a France region from https://eco2mix.rte-france.com/download/eco2mix/eCO2mix_RTE_Auvergne-Rhône-Alpes_En-cours-Consolide.zip).
I know that the unzipped content is encoded in Windows-1252. I have been able to download, unzip and CSV.read other files from the same source.
When I manually open (using my computer OS) the archive, it seems that the problematic archive has non-UTF8 character in the file name within the archive (not only in the unzipped archive content).
using ZipFile, HTTP
dl_buffer = IOBuffer(HTTP.get("https://eco2mix.rte-france.com/download/eco2mix/eCO2mix_RTE_Auvergne-Rh%C3%B4ne-Alpes_En-cours-Consolide.zip", retries=10).body)
ZipFile.Reader(dl_buffer)
But I get an error:
ERROR: ArgumentError: Invalid utf8 string: UInt8[]
Stacktrace:
[1] utf8_validate(vec::Vector{UInt8})
@ ZipFile ~/.julia/packages/ZipFile/6aqG6/src/ZipFile.jl:206
[2] _getfiles(io::IOBuffer, diroffset::UInt32, nfiles::UInt16)
@ ZipFile ~/.julia/packages/ZipFile/6aqG6/src/ZipFile.jl:359
[3] ZipFile.Reader(io::IOBuffer, close_io::Bool)
@ ZipFile ~/.julia/packages/ZipFile/6aqG6/src/ZipFile.jl:108
[4] ZipFile.Reader(io::IOBuffer)
@ ZipFile ~/.julia/packages/ZipFile/6aqG6/src/ZipFile.jl:116
[5] top-level scope
@ ~/Desktop/training-raphael-julia/main.jl:15
Any idea on how to open it correctly?
Thx