|
|
| version 1.2, 2005/02/12 12:14:00 | version 1.3, 2005/04/01 15:35:50 |
|---|---|
| Line 1 | Line 1 |
| #include "codecnv.h" | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| extern "C" { | extern "C" { |
| #endif | #endif |
| #if defined(UNICODE) && defined(OSLANG_UTF8) | UINT oemtext_sjistoucs2(UINT16 *dst, UINT dcnt, const char *src, UINT scnt); |
| UINT oemtext_sjistooem(OEMCHAR *dst, UINT dcnt, const char *src, UINT scnt); | UINT oemtext_ucs2tosjis(char *dst, UINT dcnt, const UINT16 *src, UINT scnt); |
| UINT oemtext_oemtosjis(char *dst, UINT dcnt, const OEMCHAR *src, UINT scnt); | UINT oemtext_sjistoutf8(char *dst, UINT dcnt, const char *src, UINT scnt); |
| #elif defined(UNICODE) && defined(OSLANG_UCS2) | UINT oemtext_utf8tosjis(char *dst, UINT dcnt, const char *src, UINT scnt); |
| #define oemtext_sjistooem(dst, dcnt, src, scnt) \ | |
| MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, src, -1, dst, dcnt) | |
| #define oemtext_oemtosjis(dst, dcnt, src, scnt) \ | |
| WideCharToMultiByte(CP_ACP, 0, src, -1, dst, dcnt, NULL, NULL) | |
| #endif | |
| #ifdef __cplusplus | #ifdef __cplusplus |
| } | } |
| #endif | #endif |
| #if defined(OSLANG_UTF8) | |
| #define oemtext_sjistooem oemtext_sjistoutf8 | |
| #define oemtext_oemtosjis oemtext_utf8tosjis | |
| #elif defined(OSLANG_UCS2) | |
| #define oemtext_sjistooem oemtext_sjistoucs2 | |
| #define oemtext_oemtosjis oemtext_ucs2tosjis | |
| #endif | |
| // ---- WindowsÍÑ TCHAR-OEMCHARÊÑ´¹ | |
| #undef OEMCHAR_SAME_TCHAR | |
| #if !defined(_UNICODE) && defined(OSLANG_UCS2) | |
| #define tchartooem oemtext_sjistoucs2 | |
| #define oemtotchar oemtext_ucs2tosjis | |
| #elif !defined(_UNICODE) && defined(OSLANG_UTF8) | |
| #define tchartooem oemtext_sjistoutf8 | |
| #define oemtotchar oemtext_utf8tosjis | |
| #elif defined(_UNICODE) && (defined(OSLANG_ANK) || defined(OSLANG_SJIS)) | |
| #define tchartooem oemtext_ucs2tosjis | |
| #define oemtotchar oemtext_sjistoucs2 | |
| #elif defined(_UNICODE) && defined(OSLANG_UTF8) | |
| #define tchartooem codecnv_ucs2toutf8 | |
| #define oemtotchar codecnv_utf8toucs2 | |
| #else | |
| #define OEMCHAR_SAME_TCHAR | |
| #endif | |