lib/util: Restore CH_UNIX as source charset for d_printf()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 21 Jun 2011 02:53:12 +0000 (12:53 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 21 Jun 2011 05:54:44 +0000 (15:54 +1000)
I'm changed this during the change to use the d_printf() code in
common, but should not have.

However, there is a puzzle: What is the right source charset?
Translated strings in our .mo and .msg files are in UTF8, but strings
such as file names on remote servers are in UNIX (whatever that is).
I can't see how this actually works properly when either CH_DISPLAY or
CH_UNIX are other than UTF8!

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
lib/util/dprintf.c

index a77eed84f5b776a218af0fe2fbac6d0c6923c827..376eb4c75e474372d8d7f8f4007f898a8578c59b 100644 (file)
@@ -48,7 +48,7 @@ static int d_vfprintf(FILE *f, const char *format, va_list ap)
 
        if (ret <= 0) return ret;
 
-       cret = convert_string_talloc(NULL, CH_UTF8, CH_DISPLAY, p, ret, (void **)&p2, &clen);
+       cret = convert_string_talloc(NULL, CH_UNIX, CH_DISPLAY, p, ret, (void **)&p2, &clen);
         if (!cret) {
                /* the string can't be converted - do the best we can,
                   filling in non-printing chars with '?' */