Ruslan U. Zakirov wrote:
Stas Bekman wrote:

Ruslan U. Zakirov wrote:

Apache-2 form CVS as mp2.
Some locale/UTF issues?
I think it's not critical issue and I could force make install.

Verbose make test output:
t/apache/util....1..4
# Running under perl version 5.008003 for linux
# Current time local: Tue Mar 16 18:33:54 2004
# Current time GMT:   Tue Mar 16 15:33:54 2004
# Using Test.pm version 1.24
# testing : Apache::Util::ht_time($pool)
# expected: (?-xism:^\w\w\w, \d\d \w\w\w \d\d\d\d \d\d:\d\d:\d\d)
# received: ÐÑÐ, 16 ÐÐÑ 2004 15:33:57 GMT
not ok 1


[snip]

Hello, Stas.


Ouch, I thought that \w will match any letter, but I guess it won't w/o loading locale. Does the problem go away if you apply this patch?

Nop.
I've got absolutely same results. I have ru_RU.CP1251 locale. And output from Apache::Util::ht_time conform to this. I see right date in console.

NAME locale - Perl pragma to use and avoid POSIX locales for built-in opera- tions

       This pragma tells the compiler to enable (or disable) the use of POSIX
       locales for built-in operations (LC_CTYPE for regular expressions, and
       LC_COLLATE for string comparison).  Each "use locale" or "no locale"
       affects statements to the end of the enclosing BLOCK.

So, does your LC_CTYPE matches LC_TIME? If it doesn't, that will explain the problem.

I'v checked $fmtdate with Encode::is_utf8, it's not utf8 internal format in both cases. I never used a lot 'use locale' so don't know how exactly perl handle regexps in this case.

I have success with next tricky code:
$fmtdate = Apache::Util::ht_time($r->pool);
$fmtdate = Encode::decode('cp1251', $fmtdate);

What's the transparent way to accomplish that? 'use locale' should have done that I believe. See the perllocale manpage.



-- __________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com

--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to