1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- #ifndef HEADER_CURL_MULTIBYTE_H
- #define HEADER_CURL_MULTIBYTE_H
- #include "curl_setup.h"
- #if defined(_WIN32)
-
- wchar_t *curlx_convert_UTF8_to_wchar(const char *str_utf8);
- char *curlx_convert_wchar_to_UTF8(const wchar_t *str_w);
- #endif
- #if defined(UNICODE) && defined(_WIN32)
- #define curlx_convert_UTF8_to_tchar(ptr) curlx_convert_UTF8_to_wchar((ptr))
- #define curlx_convert_tchar_to_UTF8(ptr) curlx_convert_wchar_to_UTF8((ptr))
- typedef union {
- unsigned short *tchar_ptr;
- const unsigned short *const_tchar_ptr;
- unsigned short *tbyte_ptr;
- const unsigned short *const_tbyte_ptr;
- } xcharp_u;
- #else
- #define curlx_convert_UTF8_to_tchar(ptr) (strdup)(ptr)
- #define curlx_convert_tchar_to_UTF8(ptr) (strdup)(ptr)
- typedef union {
- char *tchar_ptr;
- const char *const_tchar_ptr;
- unsigned char *tbyte_ptr;
- const unsigned char *const_tbyte_ptr;
- } xcharp_u;
- #endif
- #define curlx_unicodefree(ptr) \
- do { \
- if(ptr) { \
- (free)(ptr); \
- (ptr) = NULL; \
- } \
- } while(0)
- #endif
|