vfmg (DEVEL): vfmg - fixed radek's Legacy-Mixed decoding: * lang_...

sparky sparky at pld-linux.org
Sat Dec 31 19:34:45 CET 2005


Author: sparky                       Date: Sat Dec 31 18:34:45 2005 GMT
Module: vfmg                          Tag: DEVEL
---- Log message:
- fixed radek's Legacy-Mixed decoding:
 * lang_COUNTRY.encoding is not required, lang_COUNTRY does, and specifying
   only language is not working (why ?)
 * setlocale is part of POSIX

---- Files affected:
vfmg:
   vfmg (1.73.2.48 -> 1.73.2.49) 

---- Diffs:

================================================================
Index: vfmg/vfmg
diff -u vfmg/vfmg:1.73.2.48 vfmg/vfmg:1.73.2.49
--- vfmg/vfmg:1.73.2.48	Sat Dec 31 19:27:43 2005
+++ vfmg/vfmg	Sat Dec 31 19:34:40 2005
@@ -412,20 +412,20 @@
 			# this code is untested
 			#    --radek
 			my ($lang) = ($first =~ /^$tag_name\[([^\]]+)/);
-			if ($lang !~ /\./) {
+			if ($lang !~ /_/) {
 				warn "$File::Find::name: cannot get encoding name for"
 				  . " `$lang'. Assuming iso-8859-1\n";
 				$enc = "iso-8859-1";
 			} else {
 				require POSIX;
-				my $old_locale = setlocale(POSIX::LC_ALL());
+				my $old_locale = POSIX::setlocale(POSIX::LC_ALL());
 				eval {
-					setlocale(POSIX::LC_ALL(), $lang);
+					POSIX::setlocale(POSIX::LC_ALL(), $lang);
 					require I18N::Langinfo;
 					$enc = I18N::Langinfo::langinfo(I18N::Langinfo::CODESET());
 				};
 				warn "something went wrong: $@" if $@;
-				setlocale(POSIX::LC_ALL(), $old_locale);
+				POSIX::setlocale(POSIX::LC_ALL(), $old_locale);
 			}
 		}
 		$tags{$tag_name} = decode($enc, $tags{$first});
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/vfmg/vfmg?r1=1.73.2.48&r2=1.73.2.49&f=u



More information about the pld-cvs-commit mailing list