Hi Dave.
Yeah, we know the user who had the same problem in the past. However, In Japan,
it needed to be written by encoding of a client, and We did not want to set an initial
value to UTF-8. Therefore, It is need recognized by the warning message.
How is an attached patch proposal?
Regards,
Hiroshi Saito
----- Original Message -----
From: "Dave Page" <[EMAIL PROTECTED]>
On 08/01/2008, Andrew <[EMAIL PROTECTED]> wrote:
Excellent,
Thanks Hiroshi Saito, that worked a treat, I really appreciate you
posting those images. Apologies for taking up your time for something I
probably could have figured out by RTFM.
Yes, thanks Hiroshi (our resident encoding guru :-) ).
However, IMHO I still think it is a defect, in that it shouldn't really
be saving a 0 byte file silently, when you think it has successfully
saved your changes, and then when you go back to the file you find the
data you have worked on is lost. If it is in a mode not to support the
characters, then it should alert you that it cannot save those
characters. However, I will leave that for the development team to
decide if it is defective behaviour or behaviour by design.
Absolutely agree. Hiroshi; we do something similar in frmExport:
if (rbUnicode->GetValue())
file.Write(line, wxConvUTF8);
else
{
buf = line.mb_str(wxConvLibc);
if (!buf)
skipped++;
else
file.Write(line, wxConvLibc);
}
(we then warn the user if skipped > 0). Would something similar
suffice do you think?
/D
*** pgadmin/frm/frmQuery.cpp.orig Mon Jan 7 09:19:42 2008
--- pgadmin/frm/frmQuery.cpp Wed Jan 9 13:28:14 2008
***************
*** 1292,1298 ****
wxUtfFile file(lastPath, wxFile::write, modeUnicode ?
wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT);
if (file.IsOpened())
{
! file.Write(sqlQuery->GetText());
file.Close();
changed=false;
setExtendedTitle();
--- 1292,1299 ----
wxUtfFile file(lastPath, wxFile::write, modeUnicode ?
wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT);
if (file.IsOpened())
{
! if ((file.Write(sqlQuery->GetText()) == 0) && (!modeUnicode))
! wxMessageBox(_("Query text incomplete.\nQuery contained characters
that could not be converted to the local charset.\nPlease correct the data or try using
UTF8 instead."));
file.Close();
changed=false;
setExtendedTitle();
***************
*** 1414,1420 ****
void frmQuery::OnSaveAs(wxCommandEvent& event)
{
wxFileDialog *dlg=new wxFileDialog(this, _("Save query file as"), lastDir, lastFilename,
! _("Query files (*.sql)|*.sql|UTF-8 query files (*.sql)|*.sql|All files (*.*)|*.*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dlg->ShowModal() == wxID_OK)
{
lastFilename=dlg->GetFilename();
--- 1415,1421 ----
void frmQuery::OnSaveAs(wxCommandEvent& event)
{
wxFileDialog *dlg=new wxFileDialog(this, _("Save query file as"), lastDir, lastFilename,
! _("Query files (*.sql)|*.sql|All files (*.*)|*.*"), wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
if (dlg->ShowModal() == wxID_OK)
{
lastFilename=dlg->GetFilename();
***************
*** 1443,1449 ****
wxUtfFile file(lastPath, wxFile::write, lastFileFormat ?
wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT);
if (file.IsOpened())
{
! file.Write(sqlQuery->GetText());
file.Close();
changed=false;
setExtendedTitle();
--- 1444,1451 ----
wxUtfFile file(lastPath, wxFile::write, lastFileFormat ?
wxFONTENCODING_UTF8:wxFONTENCODING_DEFAULT);
if (file.IsOpened())
{
! if ((file.Write(sqlQuery->GetText()) == 0) && (!lastFileFormat))
! wxMessageBox(_("Query text incomplete.\nQuery contained characters
that could not be converted to the local charset.\nPlease correct the data or try using
UTF8 instead."));
file.Close();
changed=false;
setExtendedTitle();
---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match