Hello,
I don't think that Win1251 encoding is more right than UTF-8. IMHO, a
program should understand what encoding is text in or let me choose the
encoding to read the text. If you would consider this behavior as a
problem (for the conditions described) you could solve it by providing a
combobox in the Messages tab, that lets me choose the encoding of the
log. But then I will choose there the same encoding as I did before in
the File Options tab or the encoding of the database. So pgAdmin knows
which encoding to use when reading the pg_admin output stream.
And about the need and possibility of conversion, I believe that the
every line of the log is converted anyway. Please look at
sysProcess:ReadStream, there you have strings read from input and
appended to txtMessages.
str.Append(wxString::Format(wxT("%s"), wxString(buffer,
wxConvLibc).c_str()));
As I understand, wxConvLibc here specifies that the input strings always
are in OS locale encoding, but IMO this should depend on the backup
encoding.
Best regards
14.12.2011 00:20, Guillaume Lelarge пишет:
On Tue, 2011-12-13 at 08:15 +0400, Alexander LAW wrote:
Hi,
To make it clear I am posting two screenshots.
ss_backup_win1251 shows valid table name (which is "Test" in Russian),
but in ss_backup_utf8 you can see the name with wrong encoding.
When I said "pgAdmin assumes", I meant that it converts pg_admin output
stream to string as ANSI-encoded, but it's not always the case.
In fact, the opposite is common on Windows with Russian locale (and
non-ASCII object names), cause UTF-8 is a default encoding for a
database, but locale encoding (SBCS) is Win1251, and when you do backup
with a default encoding, you get an unreadable log.
pgAdmin simply displays what pg_dump gives him. If it's in the right
encoding, you'll see your tables' name correct. I'm not sure it would be
a good idea to grab every line and to convert them in whatever encoding
pgAdmin would like. If it's possible at all.
--
Sent via pgadmin-support mailing list (pgadmin-support@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-support