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

Re: Wide Char to UTF8 Conversion Functions



At 04:52 PM 10/27/00 -0600, Dave Steck wrote:
>Have refined the proposed APIs for Wide Char <---> UTF-8 conversions.
>
>int ldap_utf8_to_wc ( wchar_t *wchar, const char *utf8char );
>int ldap_utf8s_to_wcs (wchar_t *wcstr, const char *utf8str, size_t count);
>int ldap_wc_to_utf8 ( char *utf8char, wchar_t wchar, size_t count);
>int ldap_wcs_to_utf8s ( char *utf8str, const wchar_t *wcstr, size_t count );
>
>These APIs will handle 2-byte or 4-byte wchar_t types.
>
>Before we send complete doc and code, please give feedback on:
>
>1,  Are you willing to add these routines and expose the UTF8 utility functions, like ldap_utf8_next?

I have no problem with exposing these features.  I would suggest
that the prototypes be declared in a separate header.  I suggest
<ldap_utf8.h>.


>2.  Is it reasonable to give these function names with "ldap_" prefixes,  or would something else be better?
>We would suggest these and the utf8 utility functions all be named something different when exposed,
> like "lstr_".

I believe it best use the ldap_x_/LDAP_X_ name space for
functions/macros per the latest (expired) IETF LDAP C API
I-D (25.2).

>3.  Would you include these functions in libldap or a separate library?  (Some utf8 utility functions are used internally in libldap.)

If the routines only re-encode UTF-8 to a UCS-2/-4 held in
a wchar_t, I have no problem with them going in -lldap.