From: Zodiaq <zo...@as...> - 2004-02-12 14:09:48
|
Hello All MinGW users, I encountered something strange... while changing my little progs to use wide characters (for internationalization of course) it appears file names cannot use wchar_t... to hold every string I use now std::wstring, but I can't use it to open stream file... std::wofstream( ) uses char * as parameter for file name, and only way to make it work now is to convert my wide string to narrow string, i.e. std::string narrow_file_name = wide_file_name; and than open file: std::wofstream file_stream( narrow_file_name.c_str( )); I see that g++ takes that, but what if wide file name would use some asian chars? Will this conversion give proper file name when creating file? Or maybe I'm doing something wrong, maybe there is proper approach that I missed? -- regards, Zodiaq |
From: Greg C. <chi...@mi...> - 2004-02-12 16:04:15
|
Zodiaq wrote: > [i18n issue because:] > std::wofstream( ) uses char * as parameter for file name That seems to be an issue with the language standard (C++98 27.8.1.9) rather than with the gnu libstdc++ implementation. I don't know how you'd work around it without overriding basic_ofstream::open(). Perhaps this has been discussed in the C++ newsgroups. |