database encoding "WIN" -- Western or Cyrillic?

From: Preston Landers <pibble(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: database encoding "WIN" -- Western or Cyrillic?
Date: 2005-02-12 22:32:57
Message-ID: 20050212223257.31668.qmail@web81101.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The PG documents on database character set encodings, such as here:

http://www.postgresql.org/docs/8.0/interactive/multibyte.html#CHARSET-TABLE

say that the "WIN" encoding in Postgresql means cp1251, which according
to Microsoft:

http://www.microsoft.com/globaldev/reference/wincp.mspx

cp1251 is Cyrillic / Russian:

http://www.microsoft.com/globaldev/reference/sbcs/1251.htm

Whereas cp1252 is Western, also called "Windows Latin-1", "Windows
ANSI", etc.

http://www.microsoft.com/globaldev/reference/sbcs/1252.htm

If the postgresql encoding "WIN" is intended to be Cyrillic 1251, then
it should be labeled as such in the docs to avoid confusion. However,
that leaves the problem of how to create a "Western" 1252 encoded
database in Postgresql, since no encoding is specified for 1252.

Now in reality you can just use LATIN1 (8859-1) as if it were Win-1252
as long as all your clients are Windows and respect that convention.
The new characters in Windows 1252 are in spots where the original
Latin-1 didn't have anything. Where you might get into trouble is when
the web app says "OK, I see the database is using Latin-1 aka
ISO-8859-1, so I'm going to tell the client web browser that it's
ISO-8859-1." That may prevent the web browser from showing the correct
glyphs until the user manually selects codepage 1252. I'm planning to
have my web app fudge it and always report LATIN1 as windows-1252 for
now.

If the postgresql encoding "WIN" really is intended to be Western
codepage 1252, then the docs (and possibly the code?) obviously need to
be fixed, then a separate Cyrillic WIN1251 encoding created.

thanks,
Preston Landers

(pibble @t yahoo dot com)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2005-02-13 00:09:15 Re: is there anyway to get the backends IP address from the
Previous Message Tom Lane 2005-02-12 17:27:20 Re: regular expressions in query