c++ - Trying to test unicode filename retrieval/conversion to/from UTF8-UTF16 -


i've looked @ lot of examples widechartomultibyte, etc. question more testing.

i downloaded language set, chinese, simplified china machine. using virtual keyboard created directory on c:\ chinese characters in path, , placed file inside directory.

i'm trying see correct filename testing _wfopen path. have same file in location testing:

  //setlocale(lc_all, "zh-cn");   //setlocale(lc_all, "chinese_china.936");   setlocale(lc_all, "");   wchar_t* outfilename = l"c:\\特殊他\\和阿涛和润\\bracket3holes.sat";   //wchar_t* outfilename = l"c:\\heather\\bracket3holes.sat";   wchar_t w[] = l"r";   file* foo = _wfopen(outfilename, w); 

first tried without setting locale, tried various combinations of setting locale language downloaded (therefore language of path). _wfopen works fine c:\heather path, returns null pointer unicode path.

what missing? insight appreciated. note code must compilable vc9.

--- based on feedback, saved file utf-8 bom, added const before wchar_t declarations, , in debugger see right string , file pointer no longer null.

thank help. i'm still trying wrap head around all, we're trying transition const char* unicode-friendly.


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -