Prev: Performance Patches Was: [HACKERS] Lock Wait Statistics (next commitfest)
Next: contrib/xml2 pfree bug
From: Bruce Momjian on 27 Feb 2010 23:28 Hiroshi Inoue wrote: > Bruce Momjian wrote: > > Hiroshi Inoue wrote: > >> Bruce Momjian wrote: > >>> Where are we on this issue? > >> Oops I forgot it completely. > >> I have a little improved version and would post it tonight. > > > > Ah, very good. Thanks. > > Attached is an improved version. I spent many hours on this patch and am attaching an updated version. I have restructured the code and added many comments, but this is the main one: * Ideally, the server encoding and locale settings would * always match. Unfortunately, WIN32 does not support UTF-8 * values for setlocale(), even though PostgreSQL runs fine with * a UTF-8 encoding on Windows: * * http://msdn.microsoft.com/en-us/library/x99tb11d.aspx * * Therefore, we must set LC_CTYPE to match LC_NUMERIC and * LC_MONETARY, call localeconv(), and use mbstowcs() to * convert the locale-aware string, e.g. Euro symbol, which * is not in UTF-8 to the server encoding. I need someone with WIN32 experience to review and test this patch. -- Bruce Momjian <bruce(a)momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
From: Bruce Momjian on 28 Feb 2010 10:13 Bruce Momjian wrote: > Hiroshi Inoue wrote: > > Bruce Momjian wrote: > > > Hiroshi Inoue wrote: > > >> Bruce Momjian wrote: > > >>> Where are we on this issue? > > >> Oops I forgot it completely. > > >> I have a little improved version and would post it tonight. > > > > > > Ah, very good. Thanks. > > > > Attached is an improved version. > > I spent many hours on this patch and am attaching an updated version. > I have restructured the code and added many comments, but this is the > main one: > > * Ideally, the server encoding and locale settings would > * always match. Unfortunately, WIN32 does not support UTF-8 > * values for setlocale(), even though PostgreSQL runs fine with > * a UTF-8 encoding on Windows: > * > * http://msdn.microsoft.com/en-us/library/x99tb11d.aspx > * > * Therefore, we must set LC_CTYPE to match LC_NUMERIC and > * LC_MONETARY, call localeconv(), and use mbstowcs() to > * convert the locale-aware string, e.g. Euro symbol, which > * is not in UTF-8 to the server encoding. > > I need someone with WIN32 experience to review and test this patch. I don't understand why cache_locale_time() works on Windows. It sets the LC_CTYPE but does not do any encoding coversion. Do month and day-of-week names not work either, or do they work and the encoding conversion for numeric/money, e.g. Euro, it not necessary? -- Bruce Momjian <bruce(a)momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Hiroshi Inoue on 1 Mar 2010 06:00 Bruce Momjian wrote: > Bruce Momjian wrote: >> Hiroshi Inoue wrote: >>> Bruce Momjian wrote: >>>> Hiroshi Inoue wrote: >>>>> Bruce Momjian wrote: >>>>>> Where are we on this issue? >>>>> Oops I forgot it completely. >>>>> I have a little improved version and would post it tonight. >>>> Ah, very good. Thanks. >>> Attached is an improved version. >> I spent many hours on this patch and am attaching an updated version. >> I have restructured the code and added many comments, but this is the >> main one: >> >> * Ideally, the server encoding and locale settings would >> * always match. Unfortunately, WIN32 does not support UTF-8 >> * values for setlocale(), even though PostgreSQL runs fine with >> * a UTF-8 encoding on Windows: >> * >> * http://msdn.microsoft.com/en-us/library/x99tb11d.aspx >> * >> * Therefore, we must set LC_CTYPE to match LC_NUMERIC and >> * LC_MONETARY, call localeconv(), and use mbstowcs() to >> * convert the locale-aware string, e.g. Euro symbol, which >> * is not in UTF-8 to the server encoding. >> >> I need someone with WIN32 experience to review and test this patch. > > I don't understand why cache_locale_time() works on Windows. It sets > the LC_CTYPE but does not do any encoding coversion. Doesn't strftime_win32 do the conversion? > Do month and > day-of-week names not work either, or do they work and the encoding > conversion for numeric/money, e.g. Euro, it not necessary? db_strdup does the conversion. regards, Hiroshi Inoue -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Bruce Momjian on 1 Mar 2010 22:36 Hiroshi Inoue wrote: > Bruce Momjian wrote: > > Bruce Momjian wrote: > >> Hiroshi Inoue wrote: > >>> Bruce Momjian wrote: > >>>> Hiroshi Inoue wrote: > >>>>> Bruce Momjian wrote: > >>>>>> Where are we on this issue? > >>>>> Oops I forgot it completely. > >>>>> I have a little improved version and would post it tonight. > >>>> Ah, very good. Thanks. > >>> Attached is an improved version. > >> I spent many hours on this patch and am attaching an updated version. > >> I have restructured the code and added many comments, but this is the > >> main one: > >> > >> * Ideally, the server encoding and locale settings would > >> * always match. Unfortunately, WIN32 does not support UTF-8 > >> * values for setlocale(), even though PostgreSQL runs fine with > >> * a UTF-8 encoding on Windows: > >> * > >> * http://msdn.microsoft.com/en-us/library/x99tb11d.aspx > >> * > >> * Therefore, we must set LC_CTYPE to match LC_NUMERIC and > >> * LC_MONETARY, call localeconv(), and use mbstowcs() to > >> * convert the locale-aware string, e.g. Euro symbol, which > >> * is not in UTF-8 to the server encoding. > >> > >> I need someone with WIN32 experience to review and test this patch. > > > > I don't understand why cache_locale_time() works on Windows. It sets > > the LC_CTYPE but does not do any encoding coversion. > > Doesn't strftime_win32 do the conversion? Oh, I now see strftime is redefined as a macro in that C files. Thanks. > > Do month and > > day-of-week names not work either, or do they work and the encoding > > conversion for numeric/money, e.g. Euro, it not necessary? > > db_strdup does the conversion. Should we pull the encoding conversion into a separate function and have strftime_win32() and db_strdup() both call it? -- Bruce Momjian <bruce(a)momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
From: Hiroshi Inoue on 2 Mar 2010 09:40 Bruce Momjian wrote: > Hiroshi Inoue wrote: >> Bruce Momjian wrote: >>> Bruce Momjian wrote: >>>> Hiroshi Inoue wrote: >>>>> Bruce Momjian wrote: >>>>>> Hiroshi Inoue wrote: >>>>>>> Bruce Momjian wrote: >>>>>>>> Where are we on this issue? >>>>>>> Oops I forgot it completely. >>>>>>> I have a little improved version and would post it tonight. >>>>>> Ah, very good. Thanks. >>>>> Attached is an improved version. >>>> I spent many hours on this patch and am attaching an updated version. >>>> I have restructured the code and added many comments, but this is the >>>> main one: >>>> >>>> * Ideally, the server encoding and locale settings would >>>> * always match. Unfortunately, WIN32 does not support UTF-8 >>>> * values for setlocale(), even though PostgreSQL runs fine with >>>> * a UTF-8 encoding on Windows: >>>> * >>>> * http://msdn.microsoft.com/en-us/library/x99tb11d.aspx >>>> * >>>> * Therefore, we must set LC_CTYPE to match LC_NUMERIC and >>>> * LC_MONETARY, call localeconv(), and use mbstowcs() to >>>> * convert the locale-aware string, e.g. Euro symbol, which >>>> * is not in UTF-8 to the server encoding. >>>> >>>> I need someone with WIN32 experience to review and test this patch. >>> I don't understand why cache_locale_time() works on Windows. It sets >>> the LC_CTYPE but does not do any encoding coversion. >> Doesn't strftime_win32 do the conversion? > > Oh, I now see strftime is redefined as a macro in that C files. Thanks. > >>> Do month and >>> day-of-week names not work either, or do they work and the encoding >>> conversion for numeric/money, e.g. Euro, it not necessary? >> db_strdup does the conversion. > > Should we pull the encoding conversion into a separate function and have > strftime_win32() and db_strdup() both call it? We may be able to pull the conversion WideChars => UTF8 => a PG encoding into an function. BTW both PGLC_localeconv() and cache_locale_time() save the current LC_CTYPE first and restore them just before returning the functions. I'm suspicious if it's OK when errors occur in middle of the functions. regards, Hiroshi Inoue -- Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
|
Next
|
Last
Pages: 1 2 3 4 Prev: Performance Patches Was: [HACKERS] Lock Wait Statistics (next commitfest) Next: contrib/xml2 pfree bug |