T
Tejas
Hi,
I am using ldap_get_values() call to get the user attributes from
LDAP.
This call is returning the user attributes in UTF-8 encoding and its a
PCHAR*. For normal English characters this is working well. When
Multibyte characters are involved like Japanese, Chinese or Korean, I
need to convert UTF8 to ANSI encoding to get the correct values.
On Windows platform I am using MultiByteToWideChar() with the code
page CP_UTF8 to convert it to wide character string and converting it
back to ANSI string using the ATL macro W2A() with USES_CONVERSION.
I need to do the same conversion on UNIX machines. I can think of
mbstowcs() and wcstombs(). However these two calls don't change the
encoding.
Can someone let me know how do I change the encoding from UTF-8 to
ANSI string on UNIX platforms (or same call which works on both UNIX &
Windows) ?
Thanks in advance,
Ravi Nandibhatla.
I am using ldap_get_values() call to get the user attributes from
LDAP.
This call is returning the user attributes in UTF-8 encoding and its a
PCHAR*. For normal English characters this is working well. When
Multibyte characters are involved like Japanese, Chinese or Korean, I
need to convert UTF8 to ANSI encoding to get the correct values.
On Windows platform I am using MultiByteToWideChar() with the code
page CP_UTF8 to convert it to wide character string and converting it
back to ANSI string using the ATL macro W2A() with USES_CONVERSION.
I need to do the same conversion on UNIX machines. I can think of
mbstowcs() and wcstombs(). However these two calls don't change the
encoding.
Can someone let me know how do I change the encoding from UTF-8 to
ANSI string on UNIX platforms (or same call which works on both UNIX &
Windows) ?
Thanks in advance,
Ravi Nandibhatla.