-
Notifications
You must be signed in to change notification settings - Fork 47
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
Enca should probably exit 1 each time it prints 'unknown' #19
Comments
I somehow can not reproduce this: $ enca -m /tmp/123.txt
unknown
$ echo $?
1 What enca version are you using? |
As far as i see, it is not latest. I'll build it from master and try to reproduce bug sometime later |
|
Issue #19 Signed-off-by: Michal Čihař <[email protected]>
Issue #19 Signed-off-by: Michal Čihař <[email protected]>
Hmm, that's strange. On what platform is that? I've fixed some minor issues in the return codes handling, but I don't think these will fix it for you. |
I am currently running gentoo linux (4.3.6-ck). Pulled current master,
problem persists. I'll try make PR at weekend
|
sorry, no idea how to fix :( |
Can you use gdb to see process_file return value? |
@nijel no, i am completly not familar with gdb and other c-related stuff :( |
I've reproduced this. The issue appears to be, as @JelF hinted at above, that It's easiest to illustrate with an example. I'm in an en_US locale, so normally $ enca -m ~/Desktop/123.txt
enca: Cannot determine (or understand) your language preferences. [...etc...]
$ echo $?
1
$ echo `# When enca can't recognize the encoding at all`
$ enca -L none ~/Desktop/123.txt
Unrecognized encoding
$ echo $?
1
$ enca -L none -m ~/Desktop/123.txt
unknown
$ echo $?
1
$ echo `# When enca CAN identify the file encoding, but not the corresponding MIME type`
$ enca -L russian ~/Desktop/123.txt
Macintosh Cyrillic
LF line terminators
$ echo $?
0
$ enca -L russian -m ~/Desktop/123.txt
unknown
$ echo $?
0 |
I have some string, which encoding i want to detect (attached)
When i'm calling
enca -m
, result is "unknown\n", but exit code is zero (same asenca
's, where response is)
The text was updated successfully, but these errors were encountered: