SVN Commit by dpage: r4817 - in trunk/pgadmin3: . src/dlg - Mailing list pgadmin-hackers

From svn@pgadmin.org
Subject SVN Commit by dpage: r4817 - in trunk/pgadmin3: . src/dlg
Date
Msg-id 200512091102.jB9B2nC5023741@developer.pgadmin.org
Whole thread Raw
List pgadmin-hackers
Author: dpage
Date: 2005-12-09 11:02:49 +0000 (Fri, 09 Dec 2005)
New Revision: 4817

Modified:
   trunk/pgadmin3/CHANGELOG.txt
   trunk/pgadmin3/src/dlg/dlgDatabase.cpp
Log:
Default the encoding of new databases to the cluster encoding, per Peter Eisentraut.

Modified: trunk/pgadmin3/CHANGELOG.txt
===================================================================
--- trunk/pgadmin3/CHANGELOG.txt    2005-12-09 11:02:28 UTC (rev 4816)
+++ trunk/pgadmin3/CHANGELOG.txt    2005-12-09 11:02:49 UTC (rev 4817)
@@ -18,6 +18,7 @@
 </ul>
 <br>
 <ul>
+    <li>2005-12-09 DP  1.4.1  Default the encoding of new databases to the cluster encoding, per Peter Eisentraut.
     <li>2005-12-09 DP  1.4.1  Sort encoding names in dlgDatabase, per Peter Eisentraut.
     <li>2005-12-06 AP  1.4.1  store UTF8 connect info in pgpass.conf if necessary
     <li>2005-12-03 AP  1.4.1  Major fix for wx2.6.2 API changes (comboboxes)

Modified: trunk/pgadmin3/src/dlg/dlgDatabase.cpp
===================================================================
--- trunk/pgadmin3/src/dlg/dlgDatabase.cpp    2005-12-09 11:02:28 UTC (rev 4816)
+++ trunk/pgadmin3/src/dlg/dlgDatabase.cpp    2005-12-09 11:02:49 UTC (rev 4817)
@@ -195,13 +195,20 @@
         }
         while (!encStr.IsEmpty());

+        encStr=connection->ExecuteScalar(wxT("SELECT pg_encoding_to_char(encoding) FROM pg_database WHERE datname =
'template0'"));
+        encNo=cbEncoding->FindString(encStr);
+
+        if (encNo < 0)
+        {
 #if wxUSE_UNICODE
-        encNo=cbEncoding->FindString(wxT("UNICODE"));
-        if (encNo < 0)
-            encNo=cbEncoding->FindString(wxT("UTF8"));
+            encNo=cbEncoding->FindString(wxT("UNICODE"));
+            if (encNo < 0)
+                encNo=cbEncoding->FindString(wxT("UTF8"));
 #else
-        encNo=cbEncoding->FindString(wxT("SQL_ASCII"));
+            encNo=cbEncoding->FindString(wxT("SQL_ASCII"));
 #endif
+        }
+
         if (encNo >= 0)
             cbEncoding->SetSelection(encNo);



pgadmin-hackers by date:

Previous
From: svn@pgadmin.org
Date:
Subject: SVN Commit by dpage: r4816 - in branches/REL-1_4_0_PATCHES/pgadmin3: . src/dlg
Next
From: "Dave Page"
Date:
Subject: Re: Default encoding for new databases