Home --> Documentations --> PJLIB Reference
|
file | unicode.h |
| Provides Unicode conversion for Unicode OSes.
|
|
◆ PJ_DECL_ANSI_TEMP_BUF
#define PJ_DECL_ANSI_TEMP_BUF |
( |
|
buf, |
|
|
|
size |
|
) |
| |
This macro is used to declare temporary ANSI buffer for Unicode to ANSI conversion, and should be put in declaration section of a block. When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this macro will expand to nothing.
◆ PJ_DECL_UNICODE_TEMP_BUF
#define PJ_DECL_UNICODE_TEMP_BUF |
( |
|
var, |
|
|
|
size |
|
) |
| |
This macro is used to declare temporary Unicode buffer for ANSI to Unicode conversion, and should be put in declaration section of a block. When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this macro will expand to nothing.
◆ PJ_NATIVE_TO_STRING
#define PJ_NATIVE_TO_STRING |
( |
|
cs, |
|
|
|
buf, |
|
|
|
max |
|
) |
| ((char*)(const char*)cs) |
This macro will convert Unicode string to ANSI, when the platform's native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
◆ PJ_STRING_TO_NATIVE
#define PJ_STRING_TO_NATIVE |
( |
|
s, |
|
|
|
buf, |
|
|
|
max |
|
) |
| ((char*)s) |
This macro will convert ANSI string to native, when the platform's native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
◆ pj_ansi_to_unicode()
wchar_t * pj_ansi_to_unicode |
( |
const char * |
str, |
|
|
int |
len, |
|
|
wchar_t * |
wbuf, |
|
|
int |
wbuf_count |
|
) |
| |
Convert ANSI strings to Unicode strings.
- Parameters
-
str | The ANSI string to be converted. |
len | The length of the input string. |
wbuf | Buffer to hold the Unicode string output. |
wbuf_count | Buffer size, in number of elements (not bytes). |
- Returns
- The Unicode string, NULL terminated.
◆ pj_unicode_to_ansi()
char * pj_unicode_to_ansi |
( |
const wchar_t * |
wstr, |
|
|
pj_ssize_t |
len, |
|
|
char * |
buf, |
|
|
int |
buf_size |
|
) |
| |
Convert Unicode string to ANSI string.
- Parameters
-
wstr | The Unicode string to be converted. |
len | The length of the input string. |
buf | Buffer to hold the ANSI string output. |
buf_size | Size of the output buffer. |
- Returns
- The ANSI string, NULL terminated.
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|