New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
utf-16le mistaken for binary #6
Comments
I'm not sure how to fix it. Help wanted. |
We could add a check in A hacky way to implement this check is to make a system call to the Unix A more pure Ruby way to do this is to look for the Byte Order Mark in the first few bytes of the file. http://unicode.org/faq/utf_bom.html#BOM |
Update: The Charlock Holmes gem can detect UTF-16!
We should also add a check for iso-8859-1 encoded files (they're text, not binary). |
Using the unix file command rather defeats the purpose of the ptools gem, and can't be used on Windows. I'd rather not add a 3rd party dependency, either. Surely, a pure Ruby solution is possible. |
Fixed in 1.3.6, which was released today. Thanks for the report! |
ptools mistakenly treats some Unicode files as binary.
Example:
System:
The text was updated successfully, but these errors were encountered: