<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7036.0">
<TITLE>Possible patch for wxwidgets.hpp</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT FACE="Times New Roman">Wxwindows has been out of commission for at least a couple days on trunk, a problem with unicode conversion.</FONT>

<BR><FONT FACE="Times New Roman">Specifically, I have been noticing the trouble opening files -- you can select a file, but it doesn't actually open.  Also, if you select View-Messages, you get a lot of lines that aren't actually outputting the messages.</FONT></P>

<P><FONT FACE="Times New Roman">Best I can tell, this is due to some issue relative to implementing the wxwidgets.hpp wxFromLocale function, that it isn't getting a clean conversion.</FONT></P>

<P><FONT FACE="Times New Roman">I freely admit I do not know what the goal is, but from my admittedly lame review of the code I believe it is to convert from unicode input strings to multibyte internal representation.  Is this correct?</FONT></P>

<P><FONT FACE="Times New Roman">I edited the wxFromLocale function in wxwidgets.hpp, replacing it with:</FONT>
</P>

<P><FONT FACE="Times New Roman">static inline char *wxFromLocale (const wxString& string)</FONT>

<BR><FONT FACE="Times New Roman">{</FONT>

<BR><FONT FACE="Times New Roman">#if defined( wxUSE_UNICODE )</FONT>

<BR><FONT FACE="Times New Roman"># if defined( WIN32 )</FONT>

<BR><FONT FACE="Times New Roman">    return (char *) wxConvCurrent->cWX2MB(string);</FONT>

<BR><FONT FACE="Times New Roman">#  define wxLocaleFree free</FONT>
</P>

<P><FONT FACE="Times New Roman">(rest of the definition is unchanged)</FONT>
</P>

<P><FONT FACE="Times New Roman">Basically, I skip the call to FromWide in charset.h, which then invokes the Windows API call WideCharToMultiByte, and just use a wx built-in function.</FONT></P>

<P><FONT FACE="Times New Roman">I compiled it with my unicode build of wxwindows.</FONT>
</P>

<P><FONT FACE="Times New Roman">I am now able to successfully open files, and also see expected Messages (no longer blank).</FONT>
</P>

<P><FONT FACE="Times New Roman">Could someone who knows what the intent of the conversion is take a look at this patch and, hopefully, perhaps test it with some non-Western character sets?</FONT></P>

<P><FONT FACE="Times New Roman">For reference, I used this info from the wxwidgets site:</FONT>
</P>

<P><A HREF="http://www.wxwidgets.org/manuals/2.6.3/wx_mbconvclasses.html"><U><FONT COLOR="#0000FF" FACE="Times New Roman">http://www.wxwidgets.org/manuals/2.6.3/wx_mbconvclasses.html</FONT></U></A>
</P>

<P><FONT FACE="Times New Roman">Thanks.</FONT>
</P>

<P><FONT FACE="Times New Roman">Mark</FONT>
</P>

</BODY>
</HTML>