• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revision15beb9f9ef7361329b917f6d2dc5f457addf3626 (tree)
Time2006-06-12 00:01:32
Authorhenoheno <henoheno>
Commiterhenoheno

Log Message

Added --decode, --nocheck

Change Summary

Incremental Difference

--- a/encls.php
+++ b/encls.php
@@ -1,7 +1,7 @@
11 #!/usr/local/bin/php
22 <?php
33 // PukiWiki - Yet another WikiWikiWeb clone.
4-// $Id: encls.php,v 1.2 2006/05/14 15:05:19 henoheno Exp $
4+// $Id: encls.php,v 1.3 2006/06/11 15:01:32 henoheno Exp $
55 // Copyright (C) 2006 PukiWiki Developers Team
66 // License: GPL v2 or (at your option) any later version
77 //
@@ -103,6 +103,8 @@ foreach ($argv as $key => $value) {
103103 list($value, $optarg) = explode('=', $value, 2);
104104 switch ($value) {
105105 case '--all' : $f_all = TRUE; break;
106+ case '--decode' : $f_decode = TRUE; break;
107+ case '--nocheck' : $f_nocheck = TRUE; break;
106108 case '--suffix' : $suffix = $optarg; break;
107109 case '--encoding_from': $encoding_from = $optarg; break;
108110 case '--encoding_to' : $encoding_to = $optarg; break;
@@ -118,7 +120,7 @@ if ($f_all && empty($argv)) {
118120 $argv = array_keys(get_existpages('.', $suffix));
119121 } else {
120122 foreach ($argv as $arg) {
121- if (! file_exists($arg)) {
123+ if (! $f_nocheck && ! file_exists($arg)) {
122124 echo 'File not found: ' . $arg . "\n";
123125 usage();
124126 }
@@ -138,10 +140,15 @@ foreach ($argv as $arg) {
138140 $suffix = '';
139141 }
140142 //echo $name . $suffix . "\n"; // As-is
141- //echo decode($name) . $suffix . "\n"; // Decorded
142- echo encode(mb_convert_encoding(decode($name),
143- TARGET_ENCODING, SOURCE_ENCODING)) .
144- $suffix . "\n"; // Decord -> convert -> encode
143+ if ($f_decode) {
144+ // Decord
145+ echo decode($name) . $suffix . "\n";
146+ } else {
147+ // Decord -> convert -> encode
148+ echo encode(mb_convert_encoding(decode($name),
149+ TARGET_ENCODING, SOURCE_ENCODING)) .
150+ $suffix . "\n";
151+ }
145152 //echo "\n";
146153 }
147154 ?>