CH_DISPLAY and gettext

Andrew Bartlett abartlet at samba.org
Tue Jun 21 19:07:10 MDT 2011


On Wed, 2011-06-22 at 08:20 +0900, TAKAHASHI Motonobu wrote:
> > > So I'd support dropping CH_DISPLAY, unless someone can point out a
> > > good reason to keep it.
> > 
> > +1 on dropping CH_DISPLAY.
> 
> Basically I agree, I my self do not use "display charset" parameter
> explicitly and recommend that this parameter should not be set.
> 
> "display charset" was first introduced to support SWAT i18n. In those
> days most web browsers could not treat UTF-8 well. But after Samba
> 3.0.8, SWAT was changed to talk UTF-8 because of most browsers could
> support UTF-8 well.
> 
> Currently (Samba 3.0.8 or later), "display charset" affects only to
> display some messages of terminal commands. Currently the default
> valus of "display charset" is LOCALE, which means to obey LANG
> variable, actually equal to the libintl/gettext system.
> 
> So I think 
>   (1) To remove "display charset" parameter and d_printf()
>   (2) To remove d_printf() used in web/cgi.c (SWAT), simply always to
>     show with UTF-8.
>   (3) To change d_printf() used in others to gettext() if these
>     messages are expected to be written to terminal, or CH_UNIX-nizing
>     if these messages are expected to be written to (log)files.

I think I've done this, but have not removed d_printf() quite yet, in
case we find it useful for something else, and to support
display_set_stderr().  

'net' already used gettext via the N_ macro, and I hope that we can
start to translate other parts of Samba eventually.

Attached is my series of proposed patches.  I've also run this past
vorlon (Steve Langasek) of Debian because the 'display charset = LOCALE'
idea originally came from there.  I've CC'ed him here.

Andrew Bartlett
-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-util-charset-Remove-display-charset.patch
Type: text/x-patch
Size: 34506 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110622/5fa81030/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-lib-util-charset-Remove-autodetection-of-charset-fro.patch
Type: text/x-patch
Size: 4088 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110622/5fa81030/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-s3-swat-Remove-d_printf-calls.patch
Type: text/x-patch
Size: 1459 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110622/5fa81030/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-s3-net-Bind-our-gettext-results-to-unix-charset.patch
Type: text/x-patch
Size: 2522 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20110622/5fa81030/attachment-0003.bin>


More information about the samba-technical mailing list