Mercurial > dwindows
comparison os2/dw.c @ 1784:86ace55df07b
Added UTF8/Wide conversion functions on OS/2 and Windows...
Updated the readme file and some comment cleanups.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 24 Jul 2012 23:33:50 +0000 |
parents | a532ca0231ad |
children | a640714f9087 |
comparison
equal
deleted
inserted
replaced
1783:9de6d1cc8fb8 | 1784:86ace55df07b |
---|---|
13277 if(month) | 13277 if(month) |
13278 *month = DW_POINTER_TO_UINT(dw_window_get_data(window, "_dw_month")) + 1; | 13278 *month = DW_POINTER_TO_UINT(dw_window_get_data(window, "_dw_month")) + 1; |
13279 if(day) | 13279 if(day) |
13280 *day = DW_POINTER_TO_UINT(dw_window_get_data(window, "_dw_day")) + 1; | 13280 *day = DW_POINTER_TO_UINT(dw_window_get_data(window, "_dw_day")) + 1; |
13281 } | 13281 } |
13282 | |
13283 /* | |
13284 * Converts a UTF-8 encoded string into a wide string. | |
13285 * Parameters: | |
13286 * utf8string: UTF-8 encoded source string. | |
13287 * Returns: | |
13288 * Wide string that needs to be freed with dw_free() | |
13289 * or NULL on failure. | |
13290 */ | |
13291 wchar_t * API dw_utf8_to_wchar(char *utf8string) | |
13292 { | |
13293 #ifdef UNICODE | |
13294 return _UTF8toWide(utf8string); | |
13295 #else | |
13296 return NULL; | |
13297 #endif | |
13298 } | |
13299 | |
13300 /* | |
13301 * Converts a wide string into a UTF-8 encoded string. | |
13302 * Parameters: | |
13303 * wstring: Wide source string. | |
13304 * Returns: | |
13305 * UTF-8 encoded string that needs to be freed with dw_free() | |
13306 * or NULL on failure. | |
13307 */ | |
13308 char * API dw_wchar_to_utf8(wchar_t *wstring) | |
13309 { | |
13310 #ifdef UNICODE | |
13311 return _WideToUTF8(wstring); | |
13312 #else | |
13313 return NULL; | |
13314 #endif | |
13315 } |