samba-3.0.0beta1 codeset issue on non-Linux

Steve Langasek vorlon at netexpress.net
Mon Jun 16 19:24:20 GMT 2003


On Mon, Jun 16, 2003 at 09:58:16AM -0700, Richard Sharpe wrote:

> > But now let's step back from that brink.
> > 
> > Is there not some way that we could let Samba choose and use a wide
> > variety of "iconv"?  And that we provide some "fall back" options (and a
> > structure?) to handle as many of the common cases as often as possible.
> > Such as a code page to handle CP850<->UTF8 and/or CP850<->UCS-2LE, and
> > others that folk might contribute?  (Would this be re-inventing a simpler,
> > restricted GNU-iconv?)

> > See also Richard Sharpe's parallel thread about BSD.

> In fact, I believe that the native iconv on both Solaris and FreeBSD allow 
> for CP850<->UTF8 and CP850<->UCS-2LE, but neither seem to handle US-ASCII 
> (ASCII) to UCS-2LE, which is the test in Configire.

David's tests with Solaris iconv seem to suggest otherwise:
CP850<->UTF8 is supported, but CP850<->UCS-2LE is not, and this seems to
be a problem in light of this code from lib/charcnv.c --

#ifdef HAVE_NATIVE_ICONV
        if (!ret->pull) {
                ret->cd_pull = iconv_open("UCS-2LE", fromcode);
                if (ret->cd_pull != (iconv_t)-1)
                        ret->pull = sys_iconv;
        }

        if (!ret->push) {
                ret->cd_push = iconv_open(tocode, "UCS-2LE");
                if (ret->cd_push != (iconv_t)-1)
                        ret->push = sys_iconv;
        }
#endif

If I'm not mistaken, this means native iconv is only ever used for
charsets that have converters to UCS-2LE.  So while GNU iconv should not
be required, the use of UCS-2LE as the meet-point for charset
conversions seems to cramp the portability of Samba to those iconv
implementations that are actually available.

-- 
Steve Langasek
postmodern programmer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20030616/46a0acd0/attachment.bin


More information about the samba-technical mailing list