--- D:\src\main.c	2012-08-13 11:56:48.000000000 +0400
+++ D:\src\postgresql\src\backend\main\main.c	2012-08-14 13:56:19.938905100 +0400
@@ -98,6 +98,8 @@
 	 * error messages to be localized.
 	 */
 
+	SetDatabaseEncoding(GetPlatformEncoding());
+
 	set_pglocale_pgservice(argv[0], PG_TEXTDOMAIN("postgres"));
 
 #ifdef WIN32
