Gabriella439 / turtle

Shell programming, Haskell style

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid byte sequence

skatenerd opened this issue · comments

When I try to download a file that contains an "ñ" character, I get an invalid byte sequence error:

view $ inproc "curl" ["https://www2.census.gov/geo/relfiles/cdsld13/35/co_cd_35.txt"] empty

Is there a way to encourage this to somehow start using unicode?

@skatenerd: Yes. You can use the following command to specify that your program should assume a UTF-8 encoding globally:

GHC.IO.Encoding.setLocaleEncoding System.IO.utf8

Thanks! Turns out the file in question had a really strange encoding, and it wouldnt play nicely with any tooling (bash or turtle) until I ran it through iconv!

@skatenerd: You're welcome! 🙂