[Ttssh2-commit] [6036] 英文ドキュメントのチェックスクリプトを改修した。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2015年 9月 27日 (日) 00:15:12 JST


Revision: 6036
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6036
Author:   yutakapon
Date:     2015-09-27 00:15:12 +0900 (Sun, 27 Sep 2015)
Log Message:
-----------
英文ドキュメントのチェックスクリプトを改修した。
 ・調査対象外のファイルを指定できるようにした。
 ・エンコード予測に UTF-8 を追加した。

Modified Paths:
--------------
    trunk/installer/check_sjis_code.bat
    trunk/installer/check_sjis_code.pl

-------------- next part --------------
Modified: trunk/installer/check_sjis_code.bat
===================================================================
--- trunk/installer/check_sjis_code.bat	2015-09-26 14:52:42 UTC (rev 6035)
+++ trunk/installer/check_sjis_code.bat	2015-09-26 15:15:12 UTC (rev 6036)
@@ -1 +1,2 @@
 perl check_sjis_code.pl > result.txt
+rem pause

Modified: trunk/installer/check_sjis_code.pl
===================================================================
--- trunk/installer/check_sjis_code.pl	2015-09-26 14:52:42 UTC (rev 6035)
+++ trunk/installer/check_sjis_code.pl	2015-09-26 15:15:12 UTC (rev 6036)
@@ -9,6 +9,8 @@
 
 use Encode::Guess qw/shift-jis 7bit-jis/;
 
+my @exclude_files = qw(sourcecode.html);
+
 get_file_paths('../doc/en/html');
 exit(0);
 
@@ -33,6 +35,10 @@
 		if( -d "$top_dir/$path" ){                      #-- \x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82̏ꍇ\x82͎\xA9\x95\xAA\x8E\xA9\x90g\x82\xF0\x8CĂяo\x82\xB7
 			&get_file_paths("$full_path");
 			
+		} elsif (&check_exclude_file($path)) {
+			print "$full_path skipped\n";
+			next;
+			
 		} else {
 			check_sjis_code($full_path);
 		
@@ -42,6 +48,20 @@
 }
 
 
+# \x92\xB2\x8D\xB8\x91ΏۊO\x82̃t\x83@\x83C\x83\x8B\x82\xA9\x82𒲂ׂ\xE9
+sub check_exclude_file {
+	my($fn) = shift;
+	my($s);
+	
+	foreach $s (@exclude_files) {
+		if ($fn eq $s) {
+			return 1;
+		}
+	}
+	return 0;
+}
+
+
 # cf. http://charset.7jp.net/sjis.html
 # ShiftJIS \x95\xB6\x8E\x9A
 
@@ -56,12 +76,12 @@
 #		$line = chomp($line);
 #		print "$line\n";
 		
-		 my $enc = guess_encoding( $line, qw/ euc-jp shiftjis 7bit-jis / );
+		 my $enc = guess_encoding( $line, qw/ euc-jp shiftjis 7bit-jis utf8 / );
 
 		if (ref $enc) {
-			#printf "%s\n", $enc->name;
+#			printf "%s\n", $enc->name;
 			if ($enc->name !~ /ascii/) {
-				#printf "%s\n", $enc->name;
+#				printf "%s\n", $enc->name;
 				print "$filename:$no: $1\n";
 				print "$line\n";
 			}



Ttssh2-commit メーリングリストの案内
Back to archive index