Search Postgresql Archives

database encoding "WIN" -- Western or Cyrillic?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@xxxxxxxxxxxxxx)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux