On 2/16/07, Andre <[EMAIL PROTECTED]> wrote: > John Labenski <[EMAIL PROTECTED]> writes: > > > > > Ok, interesting, I guess that the problem is really with wxLua. I'm > > out of town for the rest of the week can only look at it next week. > > > > Regards, > > John Labenski > > > > With the changes I suggested in wxlua 2.8 - international characters > disappeared > this wxlua will display the right value
Just to make sure, this is the code? All that's added is to call the old way (wxConvertMB2WX) if the wxConvUTF8 fails. // Convert a 8-bit Lua String into wxString inline WXDLLIMPEXP_WXLUA wxString lua2wx(const char* luastr) { if (luastr == NULL) return wxEmptyString; // check for NULL wxString str; #if wxUSE_UNICODE str = wxString(luastr, wxConvUTF8); #else str = wxString(wxConvUTF8.cMB2WC(luastr), *wxConvCurrent); #endif // wxUSE_UNICODE if (str.IsEmpty()) str = wxConvertMB2WX(luastr); // old way that mostly works return str; } > This change keeps the support for UTF-8 on input. The problem is that I do not > see how to write UTF-8 back to the file. Also the information that the data > was > UTF-8 is hidden. > > So reading a UTF-8 file or a file with accented characters works. > > The accented characters are written back as accented characters which is good. > But how do you write a UTF-8 file using lua? There is a very lengthy > discussion > going on in wxwidgets about this problem. I am clueless about that. I will look at the wxPython code for this since hopefully they got it right or at least have it in such a way as to have it work under specified conditions. I suppose that I could fill out the rest of wxString so that you can have a wxString object in wxLua and use the wxConvXXX converters on it and wxXXXStream functions to save it "correctly" (hopefully that part at least works). I'll look into this later today. Regards, John Labenski ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ wxlua-users mailing list wxlua-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxlua-users