CH_DISPLAY and gettext

Andrew Bartlett abartlet at
Wed Jun 22 17:17:34 MDT 2011

On Wed, 2011-06-22 at 23:42 +0200, Michael Adam wrote:
> I have to correct myself in one point:
> It is not true that the names obtaind from the dc
> (via LSA calls, say) are converted to UTF8, but
> the are really converted into CH_UNIX.
> (ndr_push_charset and ndr_pull_charset convert from
> and to from CH_UNIX, respectively).
> But the main reasoning is still valid.
> We blend strings from CH_UNIX and UTF8 into
> the same string that should be processed
> further for output. And so forth.

Where do we do that?

You will see with my patch (utils/net.c) that I request that gettext
return all strings in CH_UNIX, and we now output that to the terminal.
I'm sorry for not more clearly stating that I found a way to address
those particular concerns. 

The winbindd protocol appears to be CH_UNIX, as it should be because
nss_winbindd, pam_winbindd and wbinfo should not be calling character
set conversion routines.

Now that CH_DISPLAY is gone, so is your bug about it's initialisation.
It also shows how d_printf() was ill-conceived, as it meant that 'getent
passwd' and 'wbinfo -u' would return different strings. 

Given all this, are you OK with my putting in my patch?  It takes your
option of:

> 1. replace CH_DISPLAY with CH_UNIX, i.e. always doing output
>    the same charset as the one the file system is using.

We can't do:
> 2. replace CH_DISPLAY with UTF8, i.e. always output in the
>    charset used internally and do no conversion ourselves.

It would be wrong to force display output to UTF8, as the user may
genuinely have a non-UTF8 locale, in which case all their filenames,
user names and terminal will be in that non-UTF8 charset.  If instead
UTF8 was what is used internally (as CH_UNIX), then we actually have
option 1.


Andrew Bartlett

Andrew Bartlett                      
Authentication Developer, Samba Team 

More information about the samba-technical mailing list