[PATCH] lib/Encode/Alias.pm (was warning with use Encode)

[email protected] (Daniel Lewart)
Newsgroups perl.unicode
Message-ID <[email protected]>
On Wed Apr 14, 2004 Shailesh <[email protected]> wrote:

> I'm getting this warning when using the Encode package, right off the
> bat.  This is Perl 5.8.3 on RedHat i386.  Is there a patch?  How can I
> disable the warning?

> $ perl -W -e 'use Encode;'
> False [] range "\s-" in regex; marked by <-- HERE in m/\bkoi8[\s- <--
> HERE _]*([ru])$/ at /usr/lib/perl/5.8/Encode/Alias.pm line 196.

> $ perl -v
> This is perl, v5.8.3 built for i386-linux-thread-multi
> ...

> $ set
> (no locale, lc_lang, etc. are set)

> $ perl -W -e 'use Encode::Alias;'
> (same warning as above)

> I found only thread regarding this in the comp.lang.perl.tk ng:

> http://groups.google.com/groups?th=c98d01ae005f9edd&rnum=1

This was introduced by Change 20432 (Aug 1, 2003):
	http://www.mail-archive.com/[email protected]/msg07485.html

Below is a patch.  However, i suspect that perhaps line 196 should be:
	define_alias( qr/\bkoi8[-_ ]?([ru])$/i => '"koi8-$1"' );
	                       ^^^^^^
Cheers,
Daniel Lewart
[email protected]
-------------------------------------------------------------------------------
--- lib/Encode/Alias.pm.orig	Tue May 25 11:27:25 2004
+++ lib/Encode/Alias.pm	Tue Jun  1 00:00:00 2004
@@ -193,7 +193,7 @@
   
     # Standardize on the dashed versions.
     # define_alias( qr/\butf8$/i  => '"utf-8"' );
-    define_alias( qr/\bkoi8[\s-_]*([ru])$/i => '"koi8-$1"' );
+    define_alias( qr/\bkoi8[-_\s]*([ru])$/i => '"koi8-$1"' );
 
     unless ($Encode::ON_EBCDIC){
         # for Encode::CN
-------------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.