#include <synce.h>
#include <iconv.h>
Go to the source code of this file.
Data Structures | |
| struct | t_ucs2le |
| Handle for the conversion engine. More... | |
Functions | |
| int | ucs2le_open (t_ucs2le *theHandle) |
| Initializes sring conversion engine. | |
| void | ucs2le_close (t_ucs2le *aHandle) |
| Releases resources occupied by the string conversion engine. | |
| BOOL | ucs2le_isvalid (const t_ucs2le *aHandle) |
| Checks if the given handle is valid. | |
| int | ucs2le_from (const t_ucs2le *aHandle, char *theString, LPCWSTR aWStr, size_t aMaxNum) |
| int | ucs2le_to (const t_ucs2le *aHandle, LPWSTR theWString, const char *anStr, size_t aMaxNum) |
Variables | |
| const WCHAR | WCHAR0 |
Different implementations for MS Windows and other systems. For MS Windows mbstowcs() is used for converting into UCS-2LE (what Microsoft calls unicode), while another systems use iconv().
| void ucs2le_close | ( | t_ucs2le * | aHandle | ) |
Releases resources occupied by the string conversion engine.
Does nothing under windows. Calls iconv_close() for both iconv handles else.
| aHandle | the string conversion engine handle. |
| int ucs2le_from | ( | const t_ucs2le * | aHandle, | |
| char * | theString, | |||
| LPCWSTR | aWStr, | |||
| size_t | aMaxNum | |||
| ) |
Converts the given UCS-2LE string into current codepage.
| aHandle | the string conversion engine handle. | |
| theString | the resulting string in local code page. | |
| aWStr | the string in UCS-2LE to convert. | |
| aMaxNum | the maximum number of characters to put in theString. In fact the buffer pointed by theString must be able to hold at least aMaxNum+1 characters because of the trailing 0. |
| BOOL ucs2le_isvalid | ( | const t_ucs2le * | aHandle | ) |
Checks if the given handle is valid.
For windows the handle is always valid, for non windows it is valid, if it contains valid iconv_t handles.
| aHandle | the string conversion engine handle. |
| int ucs2le_open | ( | t_ucs2le * | theHandle | ) |
Initializes sring conversion engine.
Warning! Function sets current locales in the non windows version.
| theHandle | the resulting conversion handle. Some dummy value on windows, pair of iconv handles for conversions from and to UCS-2LE on non windows. |
| int ucs2le_to | ( | const t_ucs2le * | aHandle, | |
| LPWSTR | theWString, | |||
| const char * | anStr, | |||
| size_t | aMaxNum | |||
| ) |
Converts the given string in current codepage into UCS-2LE.
| aHandle | the string conversion engine handle. | |
| theWString | the resulting string in UCS-2LE. | |
| anStr | the string in current codepage to convert. | |
| aMaxNum | the maximum number of characters to put in theWString. In fact the buffer pointed by theWString must be able to hold at least aMaxNum+1 characters because of the trailing 0. |
| const WCHAR WCHAR0 |
1.5.6