Last active
September 12, 2019 03:59
-
-
Save bneil/7cd9b33890da601dda082305f53816f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Just note taking a problem as i keep getting an illegal byte string | |
f, err := os.Open("/tmp/extra/sample.csv") | |
check(err) | |
defer f.Close() | |
in, err := ioutil.ReadAll(f) | |
check(err) | |
out := make([]byte, len(in)) | |
out = out[:] | |
_, _, err = iconv.Convert(in, out, "utf-8", "ascii") | |
check(err) | |
// ^ got that illegal byte string | |
err = ioutil.WriteFile("/tmp/extra/sample.csv2", out, 0644) | |
check(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is me just saving some code that would be useful. Im basically giving up at this point and just installing the iconv cli tool since the byte stream isnt working right T_T