windows utf8 转 utf16
static int MdesUtf8ToUtf16 ( const char* src, wchar_t * dst ){#ifdef _MSC_VER int size = MultiByteToWideChar ( CP_UTF8, 0, src, -1, dst, 0 ); return MultiByteToWideChar ( CP_UTF8, 0, src, -1, dst, size + 1 );#else dst[0] = 0; return 0;#endif}
//the most max file path 512static int my_open_utf8 (const char* device/*utf8 char*/, int flag){#ifdef _MSC_VER wchar_t wFileName[512]; MdesUtf8ToUtf16 ( device, wFileName ); return _wopen ( wFileName, flag, 0 );#endif}