Changeset 17040 for lang/cplusplus/i3
- Timestamp:
- 08/04/08 02:37:31 (5 years ago)
- Location:
- lang/cplusplus/i3
- Files:
-
- 2 modified
-
intl/loadmsgcat.c.windows-utf16 (modified) (1 diff)
-
src/LibintlUtf16le.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/i3/intl/loadmsgcat.c.windows-utf16
r17039 r17040 5 5 /**/ 6 6 7 #include <windows.h> 7 8 int 8 9 open_windows_utf8(const char *pathname8, int flags) 9 10 { 10 wchar_t pathname16[1000] = {}; 11 { // iconv 12 iconv_t cd; 13 wchar_t* pathname16_iterator; 14 size_t pathname16_bytes_left; 15 char* pathname8_iterator; 16 size_t pathname8_bytes_left; 17 int result; 18 19 pathname16_iterator = (char*)pathname16; 20 pathname16_bytes_left = sizeof(pathname16) -1;//"-1" for null term 21 pathname8_iterator = pathname8; 22 pathname8_bytes_left = strlen(pathname8); 23 24 cd = iconv_open("UTF-16LE", "UTF-8"); 25 26 result = iconv(cd, 27 &pathname8_iterator, 28 &pathname8_bytes_left, 29 (char*)&pathname16_iterator, 30 &pathname16_bytes_left); 31 32 if (result == -1) { 33 errno = EACCES; 34 return -1; 35 } 36 37 iconv_close(cd); 11 wchar_t pathname16[1000]; 12 if (0 == MultiByteToWideChar( 13 CP_UTF8, 14 0, 15 pathname8, 16 -1, 17 pathname16, 18 sizeof(pathname16))) { 19 return -1; 38 20 } 39 21 return _wopen(pathname16, flags); -
lang/cplusplus/i3/src/LibintlUtf16le.h
r17038 r17040 23 23 24 24 namespace i3 { 25 extern const char* locale_dir_utf8_;25 extern const char* windows_locale_dir_utf8_; 26 26 } 27 27 #undef LOCALEDIR 28 #define LOCALEDIR (i3:: locale_dir_utf8_)28 #define LOCALEDIR (i3::windows_locale_dir_utf8_) 29 29 30 30 #endif
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)