On Sat, 04 Oct 2003 05:20:23 -0700 Robert Vazan <[EMAIL PROTECTED]> wrote:

RV> Update of /cvsroot/mahogany/M/src/adb
RV> In directory sc8-pr-cvs1:/tmp/cvs-serv29831/src/adb
RV> 
RV> Modified Files:
RV>     ProvLine.cpp 
RV> Log Message:
RV> Blind fix for wide characters

 No, won't work. c_str() returns "wchar_t *" in Unicode build.

RV> Index: ProvLine.cpp
RV> ===================================================================
RV> RCS file: /cvsroot/mahogany/M/src/adb/ProvLine.cpp,v
RV> retrieving revision 1.5
RV> retrieving revision 1.6
RV> diff -b -u -2 -r1.5 -r1.6
RV> --- ProvLine.cpp    18 Sep 2003 16:30:47 -0000      1.5
RV> +++ ProvLine.cpp    4 Oct 2003 12:20:21 -0000       1.6
RV> @@ -226,8 +226,8 @@
RV>     m_dirty = false;
RV>     
RV> -   ifstream stream(m_file);
RV> +   ifstream stream(m_file.c_str());

 This should normally be mb_str() (multi byte string independently of
Unicode setting) but here it should even be fn_str() (as file names are
sometimes multibyte and sometimes Unicode) and ifstream should be replaced
by wfstream in Unicode mode.

 Better yet, why not just use wx(Text)File... Streams don't bring any
advantage here and wx classes are Unicode-compatible and have built in
error reporting (your message "can't open file" is less informative than
wxFile message including streerror()).

 Regards,
VZ



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-Developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-developers

Reply via email to