-
Notifications
You must be signed in to change notification settings - Fork 440
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
Text files not recognised by magic #57
Comments
I've got the same problem. |
1 similar comment
I've got the same problem. |
I confirm the issue, every plain textual file like csv, json, css, txt are not recognized. The workaround is to return text/plain if the result of by_magic is nil, but this will make some side effects (example for application/octet-stream. Other suggestions? |
It appears to only detect text files by magic if the files begin with the strings:
Needless to say, this would only appear to cover a minimal subset of text files. |
I have a proposed PR for testing for CSVs: #75 |
Is it possible to test via file extension and then via magic? This should handle the tex, json, css, csv cases. |
If you want to be able to match and be mostly sure, you have to parse at least part of the file. I'm not sure with the current setup that you actually can correctly check for CSVs, JSON, CSS, and etc. You can check by extension, but I can do that without the library. |
Has any movement been made on this? I just ran into this problem on a project I'm working on and could really use a solution. |
Invalid, this should be fixed in the shared-mime-info database upstream. |
Somehow plaintext files are not recognised:
The text was updated successfully, but these errors were encountered: