[Date Prev][Date Next]
MultiByte to UTF8 Conversion Functions
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 )
I like Kurt's idea of the application sending in the charset translation function. The last parameter is the translation function, which is compatible with the ANSI C functions. It most cases, applications can just use the ANSI C functions. (Perhaps NULL could cause these to be used by default.)
These APIs will give applications a simple way to be working in the local code page, and to properly convert strings to UTF8 for LDAP calls.
Dave Steck 801-861-5219
Novell, Inc., the leading provider of Net services software