From: | svn(at)pgadmin(dot)org |
---|---|
To: | pgadmin-hackers(at)postgresql(dot)org |
Subject: | SVN Commit by andreas: r4957 - trunk/pgadmin3/src/frm |
Date: | 2006-01-24 19:00:25 |
Message-ID: | 200601241900.k0OJ0PCt014414@developer.pgadmin.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
Author: andreas
Date: 2006-01-24 19:00:17 +0000 (Tue, 24 Jan 2006)
New Revision: 4957
Modified:
trunk/pgadmin3/src/frm/frmConfig.cpp
Log:
read/write config files with wxUtfFile and wxFONTENCODING_SYSTEM
Modified: trunk/pgadmin3/src/frm/frmConfig.cpp
===================================================================
--- trunk/pgadmin3/src/frm/frmConfig.cpp 2006-01-24 08:35:08 UTC (rev 4956)
+++ trunk/pgadmin3/src/frm/frmConfig.cpp 2006-01-24 19:00:17 UTC (rev 4957)
@@ -301,20 +301,18 @@
void frmConfig::OpenLastFile()
{
- wxFile file(lastPath, wxFile::read);
+ wxUtfFile file(lastPath, wxFile::read, wxFONTENCODING_SYSTEM);
if (file.IsOpened())
{
#ifdef __WXMSW__
_setmode(file.fd(), _O_BINARY);
#endif
- char *buffer=new char[file.Length()+1];
- int cnt=file.Read(buffer,file.Length());
- buffer[cnt] = 0;
+ wxString buffer;
+ file.Read(buffer);
file.Close();
- DisplayFile(wxString(buffer, wxConvLibc));
+ DisplayFile(buffer);
- delete buffer;
statusBar->SetStatusText(wxString::Format(_(" Configuration read from %s"), lastPath.c_str()));
fileMenu->Enable(MNU_SAVE, false);
@@ -373,9 +371,12 @@
}
else
{
- wxFile file(lastPath, wxFile::write);
+ wxUtfFile file(lastPath, wxFile::write, wxFONTENCODING_SYSTEM);
if (file.IsOpened())
{
+#ifdef __WXMSW__
+ _setmode(file.fd(), _O_BINARY);
+#endif
file.Write(str);
file.Close();
done=true;
From | Date | Subject | |
---|---|---|---|
Next Message | Andreas Pflug | 2006-01-24 19:07:50 | Re: bugfix: Encoding of config files |
Previous Message | Miha Radej | 2006-01-24 11:21:08 | Re: Missing make files, etc |