Re: Small modification - Mailing list pgadmin-hackers

From Andreas Pflug
Subject Re: Small modification
Date
Msg-id 3F41E4C5.5000704@pse-consulting.de
Whole thread Raw
In response to Re: Small modification  ("Hiroshi Saito" <saito@inetrt.skcapi.co.jp>)
List pgadmin-hackers
Hiroshi Saito wrote:

>From: "Andreas Pflug" <pgadmin@pse-consulting.de>
>
>
>
>>Hi Hiroshi,
>>
>>
>(snip)
>[> Can't say anything about that, please continue using the frozen
>
>
>>wxWindows-pgAdmin3-20030722 version. Any later version is unpredictable
>>until we have a wx2.5 release.
>>
>>Regards,
>>Andreas
>>
>>
>
>Ok.
>The problem that it was flown here doesn't occur in 20030722 version.
>
>But, I am not satisfied with this version.
>A language choice can't be done freely by one as a big problem in FreeBSD.
>https://sourceforge.net/tracker/?func=detail&atid=309863&aid=775994&group_id
>=9863
>It wants this edition which coped with it at least.
>
I understand this, but upgrading to a new version means some debugging
because cvs usually has several bugs in it (as you noticed). Actually, I
believe the way the locale is chosen is very unfortunate.

Dave, could you apply the appended patch to our 20030722 version of
src/common/intl.cpp? It will make Hiroshi happy :-)

Regards,
Andreas
@@ -683,27 +683,11 @@
 static wxWCharBuffer wxSetlocaleTryUTF(int c, const wxChar *lc)
 {
     wxMB2WXbuf l = wxSetlocale(c, lc);
+    if ( !l && lc && lc[0] != 0 )
-    if ( lc && lc[0] != 0 && !l )
     {
         wxString buf(lc);
+        wxString buf2;
+        buf2 = buf + wxT(".UTF-8");
+        l = wxSetlocale(c, buf2.c_str());
+        if ( !l )
+        {
+            buf2 = buf + wxT(".utf-8");
+            l = wxSetlocale(c, buf2.c_str());
+        }
+        if ( !l )
+        {
+            buf2 = buf + wxT(".UTF8");
+            l = wxSetlocale(c, buf2.c_str());
+        }
+        if ( !l )
+        {
+            buf2 = buf + wxT(".utf8");
+            l = wxSetlocale(c, buf2.c_str());
+        }
-        buf += wxT(".utf8");
-        l = wxSetlocale(c, buf.c_str());
     }
     return l;
 }

pgadmin-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: Alt-Tab Icon
Next
From: Jean-Michel POURE
Date:
Subject: Re: Slovene Translation