[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: MultiByte to UTF8 Conversion Functions



At 05:15 PM 10/27/00 -0600, Dave Steck wrote:
>While the Wide Char to UTF8 functions are our first priority, we'd like OpenLDAP to consider these functions as well.
>
>ldap_mb_to_utf8 ( char *utf8char, const char *mbchar, size_t count,  mbtowc )
>ldap_mbs_to_utf8s ( char *utf8str, const char *mbstr, size_t count, mbstowcs )
>ldap_utf8_to_mb ( char *mbchar, const char *utf8char, size_t count, wctomb )
>ldap_utf8s_to_mbs ( char *mbstr, const char *utf8str, size_t count, wcstombs )

no problem with these as well.

>I like Kurt's idea of the application sending in the charset translation function.

Note that regardless of whether the going to(from) UTF-8 from(to)
wchar_t or multibyte, character set translation may be needed.

> (Perhaps NULL could cause these to be used by default.)

NULL should imply no character set translation.  That is that
a wchar_t holds a Unicode character (UCS-2/4) and a
multiple byte is some multiple byte Unicode transform
(UTF-1/8/16).