wxGTK and UTF-8
Olly Betts
olly at survex.com
Mon Jul 3 09:46:17 PDT 2006
On 2006-07-03, Vadim Zeitlin wrote:
> This is not the point. IIRC, wxGTK1 applications using ISO8859-1 didn't
> work when the system locale was UTF-8 which was the reason behind adding
> the hack in wxLocale::GetSystemEncoding(). All I ask for is that we check
> that they still work if we remove it now.
OK, I misunderstood.
I've just tried it with GTK1 and CVS HEAD and my app crashes and hangs
frequently with or without the suspect code in src/common/intl.cpp (and
whether or not I set the font encoding to utf-8). So I think GTK1
support in CVS HEAD has already bitrotted. I needed to apply this patch
just to get it to compile with 2.6 compatability off:
Index: src/gtk1/window.cpp
===================================================================
RCS file: /pack/cvsroots/wxwidgets/wxWidgets/src/gtk1/window.cpp,v
retrieving revision 1.581
diff -p -u -r1.581 window.cpp
--- src/gtk1/window.cpp 2006/06/15 17:58:24 1.581
+++ src/gtk1/window.cpp 2006/07/03 16:35:18
@@ -826,7 +826,7 @@ static long wxTranslateKeySymToWXKey(Key
break;
case GDK_KP_Next: // == GDK_KP_Page_Down
- key_code = isChar ? WXK_NEXT : WXK_NUMPAD_PAGEDOWN;
+ key_code = isChar ? WXK_PAGEDOWN : WXK_NUMPAD_PAGEDOWN;
break;
case GDK_KP_End:
Personally I think GTK1 will be irrelevant by the time wx 2.8 is
released, but if you're still worried about GTK1, just leave the test in
place as Stephan suggested. It seems we no longer know what this was
supposed to fix so it'll be hard to confirm that it's no longer an
issue, even if GTK1 support was working well. Unless Julian knows - he
made the corresponding change for Motif in March this year with the
comments (on HEAD and the 2.6 branch):
wxMotif/ANSI can't cope with UTF-8
Better fix for encoding problem: wxMotif in ANSI mode can't cope with UTF-8
I don't really believe that forcing ISO8859-1 in this situation can be
the right thing to do, but nobody seems to have complained so far so it
can't be all that bad!
Cheers,
Olly
More information about the wx-dev
mailing list