-
Notifications
You must be signed in to change notification settings - Fork 714
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
hostwatch assumes ASCII-only locale #377
Comments
Do you want to test My suspicion is that it may not work. I think netstat may just copy the bytes in the hostname as is. We could assume that the output is always UTF8, but is this really the case? There could be systems out there that are using other encodings. Does this need to be configurable? |
Well, here's a line of output from
Note the non-ASCII
Note the ASCII-only-ness. Therefore my suggestion is: Stick to ASCII-only, but call netstat with |
Yes, it sounds like setting Oh, interesting, looks like we do the right thing for other external commands, e.g.
However the call in |
* Make hostwatch locale-independent See #377: hostwatch used to call netstat and parse the result, without setting the locale. The problem is converting the binary output to a unicode string, as the locale may be utf-8, latin-1, or literally anything. Setting the locale to C avoids this issue, as netstat's source strings to not use non-ASCII characters. * Break line, check all other invocations
Merged fix, closing. |
This sounds like the same bug as #110 and #93, but I'm using version 0.78.5, and those issues claim it has been resolved in 0.78.1 and "0.78.1.dev6<+ng1d64879" (which I guess is older than 0.78.5).
Here's a part of the log:
And here's the first 570 (>522) bytes of output of
ssh myremote netstat
:Note the non-ASCII character
ä
inDomäne
.Maybe change the invocation to something like
LC_ALL=C netstat
, wouldn't this fix the problem?The text was updated successfully, but these errors were encountered: