Skip to content

Instantly share code, notes, and snippets.

@ryanmeasel
Created May 15, 2018 21:54
Show Gist options
  • Save ryanmeasel/10048eed7277cb223afc4b69298d79c6 to your computer and use it in GitHub Desktop.
Save ryanmeasel/10048eed7277cb223afc4b69298d79c6 to your computer and use it in GitHub Desktop.
Convert file text encoding
# When you receive "warning: null character(s) ignore", there is a null byte hidden number in the source code.
# This is likely the result of creating a file in Visual Studio which defaults to UTF-16LE and trying to read
# it back as UTF8.
# To check text encoding of the file, run the following and retrieve the `charset`
file -I [FILE]
# To convert the file to UTF8 (or any other encoding)
iconv -f [CURRENT_ENCODING] -t UTF8 [FILE] > temp
mv temp [FILE]
@ryanmeasel
Copy link
Author

also, dos2unix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment