Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] helpfiles: Also accept 'UTF-8' as an encoding name.



---
 Util/helpfiles | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Locale names may be either xx_YY.UTF8 or xx_YY.UTF-8.

Also fixed a typo: lc_type --> lc_ctype


diff --git a/Util/helpfiles b/Util/helpfiles
index ba1c50a..3e3125e 100755
--- a/Util/helpfiles
+++ b/Util/helpfiles
@@ -56,11 +56,11 @@ sub Die {
 delete($ENV{'LC_ALL'});
 $ENV{'LANG'} = 'C';
 if($ARGV[0] =~ /-f(.*)/) {
-    $lc_type = $1;
+    $lc_ctype = $1;
     shift(@ARGV);
     &Usage() unless(@ARGV);
-    if($lc_type eq '') {
-        $lc_type = shift(@ARGV);
+    if($lc_ctype eq '') {
+        $lc_ctype = shift(@ARGV);
         &Usage() unless(@ARGV);
     }
 } else {
@@ -68,10 +68,10 @@ if($ARGV[0] =~ /-f(.*)/) {
     $lc_ctype = '';
     $choice = 0;
     while(<LOCALE>) {
-        if(/en.*utf8/i) {
+        if(/en.*utf-?8/i) {
             $lc_ctype = $_;
             last;
-        } elsif(/utf8/i) {
+        } elsif(/utf-?8/i) {
             $lc_ctype = $_;
             $choice = 2;
         } elsif(($choice < 1) && (/(en)|\./i)) {
-- 
1.8.3.4 (Apple Git-47)




Messages sorted by: Reverse Date, Date, Thread, Author