From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13383 invoked by alias); 13 Nov 2013 18:46:56 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31976 Received: (qmail 22451 invoked from network); 13 Nov 2013 18:46:51 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 X-Injected-Via-Gmane: http://gmane.org/ To: zsh-workers@zsh.org From: Martin Vaeth Subject: Re: [PATCH] helpfiles: Also accept 'UTF-8' as an encoding name. Date: Wed, 13 Nov 2013 18:28:08 +0000 (UTC) Message-ID: References: <20131110181333.7682d38f@pws-pc.ntlworld.com> <131110183043.ZM21795@torch.brasslantern.com> <131111084228.ZM26372@torch.brasslantern.com> <20131112101139.31d67b73@pwslap01u.europe.root.pri> <35BD8D7E-01D5-469D-95DD-3030251D22AB@kba.biglobe.ne.jp> <131113092737.ZM11794@torch.brasslantern.com> Reply-To: vaeth@mathematik.uni-wuerzburg.de X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: lounge.imp.fu-berlin.de User-Agent: slrn/pre1.0.0-26 (Linux) Bart Schaefer wrote: > > Are you sure you didn't mean (/(^en)|\./i) ? It's really OK for the > "en" to appear anywhere? There are so many "standards" for locale names that I really do not know what is the best: For instance, for the similar "de" (which might perhaps also be checked) there are besides de_* also fy_DE and hsb_DE on a Debian installation at my institute (though I do not know what they mean). On the other hand, you are right that e.g. ca_ES@valencia should perhaps not be matching... Perhaps something like /((^|[^a-z])(en|de))|\./i is better? Anyhow, all these fallbacks are a poor choice anyway. > And wouldn't you want to prefer something that contains "en" > to somethimg that was found previously but has "."? It is easy to add further distinctions with } elsif(($choice < 2) && (/.../)) { # second-to-worst fallback $lc_ctype = $_; $choice = 2; } elsif(($choice < 1) && (/.../)) { # worst fallback $lc_ctype = $_; $choice = 1; } (and increasing the previous assignments of $choice correspondingly: The idea is that $choice is measuring the quality of the "best" match so far). However, I am not sure whether this really makes sense and what is reasonable to put into /.../: As mentioned, probably none of the fallbacks is ideal, anyway.