Hi Peter-san.

I see the problem for being an original domain in plpgsql. It differs from what codeset meant at postmaster by Japanese windows.... Please see, this look at the problem on which SJIS enters into a message. http://winpg.jp/~saito/pg_work/LC_MESSAGE_CHECK/plpgsql/before_plpgsql_server.log This state is the following. ==
lc_messages=ja
server_encoding=utf-8
==

Therefore,  it needs to be codeset called for an original domain. It is the 
procedure in which
only a server module must correspond. Then, It is solvable by this patch. http://winpg.jp/~saito/pg_work/LC_MESSAGE_CHECK/plpgsql/after_plpgsql_server.log

Please take this into consideration. Tahnks.

Regards,
Hiroshi Saito

----- Original Message ----- From: "Peter Eisentraut" <pete...@gmx.net>


Alvaro Herrera wrote:
Peter Eisentraut wrote:
Log Message:
-----------
Redefine _() to dgettext() instead of gettext() so that it uses the plpgsql
text domain, instead of the postgres one (or whatever the default may be).

Hmm, so is this needed on all other PLs too?

In principle yes. Or call dgettext() explicitly, which is also done in some cases. However, in most cases messages are issued through ereport(), which handles this automatically (which you implemented, I recall).
*** src/backend/utils/mb/mbutils.c.orig Sun Mar  1 01:46:59 2009
--- src/backend/utils/mb/mbutils.c      Sun Mar  1 01:46:48 2009
***************
*** 883,888 ****
--- 883,905 ----
 #endif /* WIN32 */
void
+ SetDomainCodeSet(const char *domainname)
+ {
+ #if defined(ENABLE_NLS) && defined(WIN32)
+       int     i;
+       for (i = 0; i < sizeof(codeset_map_array) / 
sizeof(codeset_map_array[0]); i++)
+       {
+               if (codeset_map_array[i].encoding == GetDatabaseEncoding())
+               {
+                       if (bind_textdomain_codeset(domainname, 
codeset_map_array[i].codeset) == NULL)
+                               elog(LOG, "bind_textdomain_codeset failed");
+                       break;
+               }
+       }
+ #endif
+ }
+ + void
 SetDatabaseEncoding(int encoding)
 {
        if (!PG_VALID_BE_ENCODING(encoding))
*** src/include/mb/pg_wchar.h.orig      Sun Mar  1 01:49:00 2009
--- src/include/mb/pg_wchar.h   Sun Mar  1 01:49:48 2009
***************
*** 389,394 ****
--- 389,395 ----
 extern int     pg_get_client_encoding(void);
 extern const char *pg_get_client_encoding_name(void);
+ extern void SetDomainCodeSet(const char *domainname);
 extern void SetDatabaseEncoding(int encoding);
 extern int     GetDatabaseEncoding(void);
 extern const char *GetDatabaseEncodingName(void);
*** src/pl/plpgsql/src/pl_handler.c.orig        Sun Mar  1 01:55:34 2009
--- src/pl/plpgsql/src/pl_handler.c     Sun Mar  1 01:57:58 2009
***************
*** 22,27 ****
--- 22,28 ----
 #include "utils/guc.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
+ #include "mb/pg_wchar.h"
PG_MODULE_MAGIC; ***************
*** 43,48 ****
--- 44,51 ----
                return;
pg_bindtextdomain(TEXTDOMAIN);
+       /* domain codeset */
+       SetDomainCodeSet(TEXTDOMAIN);
plpgsql_HashTableInit();
        RegisterXactCallback(plpgsql_xact_cb, NULL);
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to