From 59943926a85964ef3d691a04c3f267d690f51e2c Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Wed, 1 Apr 2009 10:44:07 +0000 Subject: [PATCH] DBD-SQLite: use locale may not work well under the windows, especially for the non-westerners --- t/12create_collation.t | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/t/12create_collation.t b/t/12create_collation.t index 0c35c8c..2f9aea1 100644 --- a/t/12create_collation.t +++ b/t/12create_collation.t @@ -10,7 +10,15 @@ use Test::More tests => 8; use DBI; use Encode qw/decode/; - +BEGIN { + # sadly perl for windows (and probably sqlite, too) may hang + # if the system locale doesn't support european languages. + # en-us should be a safe default. if it doesn't work, use 'C'. + if ($^O eq 'MSWin32') { + use POSIX 'locale_h'; + setlocale(LC_COLLATE, 'en-us'); + } +} my @words = qw/berger Bergère bergère Bergere HOT hôte