# Open zip file with non UTF-8 encoding

**URL:** https://discourse.julialang.org/t/open-zip-file-with-non-utf-8-encoding/85241
**Category:** Data
**Tags:** zip
**Created:** [August 3, 2022, 3:56pm UTC](https://discourse.julialang.org/t/open-zip-file-with-non-utf-8-encoding/85241 "2022-08-03T15:56:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![julien\_goo](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@julien\_goo](https://discourse.julialang.org/u/julien_goo)
#### Post date: [August 3, 2022, 3:56pm UTC](https://discourse.julialang.org/t/open-zip-file-with-non-utf-8-encoding/85241/1 "2022-08-03T15:56:29Z")

</div>

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](https://eco2mix.rte-france.com/download/eco2mix/eCO2mix_RTE_Auvergne-Rh%C3%B4ne-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).

```julia
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:

```julia
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

---

<div class="post-metadata">

### Author: ![julien\_goo](https://avatars.discourse-cdn.com/v4/letter/j/ce73a5/32.png) [@julien\_goo](https://discourse.julialang.org/u/julien_goo)
#### Post date: [August 5, 2022, 9:14am UTC](https://discourse.julialang.org/t/open-zip-file-with-non-utf-8-encoding/85241/2 "2022-08-05T09:14:44Z")

</div>

Problem solved. I have used InfoZIP package and it works like a charm.  
But I still have no clear reason of why this difference.
