Skip Menu |

This queue is for tickets about the Unicode-Collate CPAN distribution.

Report information
The Basics
Id: 63185
Status: resolved
Priority: 0/
Queue: Unicode-Collate

People
Owner: Nobody in particular
Requestors: PHILKIME [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.67-withoutworldwriteables
Fixed in: (no value)



Subject: Can't query Locale values to avoid override error
Some Locales have things like "upper_before_lower" set and so when creating a new Unicode::Collate::Locale object with this option, U::C dies with the error, for example: upper_before_lower is reserved by da_DK.UTF-8, can't be overwritten at ... It would be good to have a method to check if this is set in the Locale so that this error can be avoided, something like: $locale->has_default('upper_before_lower') or something.
Also, perhaps we could have an override like upper_before_lower => force which is like "true" but overrides the locale setting?
Subject: Re: [rt.cpan.org #63185] Can't query Locale values to avoid override error
Date: Sun, 21 Nov 2010 23:13:27 +0900
To: bug-Unicode-Collate [...] rt.cpan.org
From: SADAHIRO Tomoyuki <bqw10602 [...] nifty.com>
Show quoted text
> Queue: Unicode-Collate > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=63185 > > > Also, perhaps we could have an override like > > upper_before_lower => force > > which is like "true" but overrides the locale setting?
Whether $yours is true or false, the following will die, as the Danish tailoring uses upper_before_lower. my $da = Unicode::Collate::Locale->new( locale => 'da', upper_before_lower => $yours, ); # croaked This behavior is intended so that users can know that Danish uses it and see if such a tailoring might be wrong. (when the user has opportunity to rewrite the code) If a user intentionally wants to override it, the user can use the change() method of Unicode::Collate. my $da = Unicode::Collate::Locale->new( locale => 'da', )->change( upper_before_lower => $yours, ); # works The original value can be got as the return value (list context) from the change method. my $da = Unicode::Collate::Locale->new( locale => 'da', ); my %original = $da->change( upper_before_lower => $yours, ); if ($original{upper_before_lower}) { ... } regards, sadahiro tomoyuki
Ok, that's great, thanks for the help.