-
Notifications
You must be signed in to change notification settings - Fork 481
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
Support encoding on glib compiled with libiconv #1048
Comments
Although, most libc implementations provide a native iconv with various aliases, libiconv does not know about the alias `utf8`. Neither does glib provide this alias if compiled with libiconv. Furthermore, be advised that the user can only specify in the syslog-ng config those iconv codes which are supported by the local iconv or libiconv. Fixes syslog-ng#1048 Regression introduced: 3fa6028 "logproto: handle invalid encoding() options at parsing time" Signed-off-by: bkil-syslogng <tamas.nagy@balabit.com>
As a further enhancement, should we also add an |
I dont think so. The value in logmatcher is a pcre flag and not an encoding
|
Well, as we see, some people prefer writing |
There's an alias: unicode. I dont mind the dashed version either.
|
If the user compiles glib with libiconv on a platform without a native iconv, character encoding can not be specified. (The issue is not easy to reproduce on many systems, but
LD_PRELOAD
should do the trick.)Given the following config:
Startup fails with the following message:
It worked correctly on syslog-ng 3.7.3.
The root cause is that
lib/logproto/logproto-server.c
checks supported encodings by first trying to convert from "utf8" to the given encoding. However, this always fails because "utf8" is not considered a valid encoding on some of the libraries. Internal canonicalization is done by upper casing each character.On a separate note, this analysis concludes that the user should be advised that only those codes can be used in a syslog-ng config which are supported by the used
iconv
implementation, i.e., giving{ program("cat" encoding("UTF8")); }
should also fail on such a system. syslog-ng does not implement an extra aliasing layer and glib's aliasing doesn't seem to be exhaustive in this regard either.Here are the aliases for
libiconv
:Here are some of the aliases for
glib
:The text was updated successfully, but these errors were encountered: