山田邦博です。

Mkphothhtml Version 2.2(バージョン アップ)の投稿です。

  ディジタルカメラ(Digital Camera)で多量に撮った写真を簡単に整理し、
Netscape や Mozilla 等の一般的なブラウザ(Web browser) で見れるようにする
ものです。 Network photo album としての機能も持っています。
Unix ユーザ(Unix user)向けです。

変更内容は、Contents.db および photo.html が全て US-ASCII であった時に、
その charset を "utf-8" ではなく "us-ascii" にします。
(Bug fixed と考えて下さい。)

-...-

Mkphotohtml Ver.2.2 の全てのファイルは

        ftp://ftp.tksa.gr.jp/king/image/Mkphotohtml_2.2.tgz

にあります。
これには、インストーラ、小さな関連プログラム(便利グッズ)、設定例、細か
いドキュメント等が含まれています。

最新の Mkphotohtml (ドキュメントを含む)については

       http://www.tksa.gr.jp/king/Software/Mkphotohtml/index.html

を参照して下さい。
そこに実例(http://www.tksa.gr.jp/cats/photo.html)も示しておきました。

-...-

以下に Ver.2.1 に対する diff を最後に添付します。
文書(doc)は diff だけ、プログラム(bin)は diff+shar です。
設定ファイル(etc)については変更がありません。


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


##### (BEGIN) cut here for documents #####
diff -ru Mkphotohtml_2.1/doc/Change.log Mkphotohtml_2.2/doc/Change.log
--- Mkphotohtml_2.1/doc/Change.log      2004-03-05 00:18:29.000000000 +0900
+++ Mkphotohtml_2.2/doc/Change.log      2004-10-12 14:00:13.000000000 +0900
@@ -1,3 +1,11 @@
+12 Oct.2004
+       Version 2.2 : Released
+
+8 Apr.2004
+       set "charset=us-ascii" if only us-ascii is used in Contents.db and
+       photo.html .
+       $charset introduced.
+
 5 Mar.2004
        Version 2.1 : Released
 
diff -ru Mkphotohtml_2.1/doc/MUMBLE.jp.txt Mkphotohtml_2.2/doc/MUMBLE.jp.txt
--- Mkphotohtml_2.1/doc/MUMBLE.jp.txt   2003-11-11 15:37:00.000000000 +0900
+++ Mkphotohtml_2.2/doc/MUMBLE.jp.txt   2004-10-12 14:03:54.000000000 +0900
@@ -108,6 +108,8 @@
 の jis,sjis,euc-jp のペイジが正常に見れなくなる。 おかげで、Lynx を 2
 個使うはめになっている。
 
+この問題は、Debian GNU/Linux Sarge では一応解決されている。
+
 -...-
 
 Charset の標準を私は iso-2022-jp にしていますが、これはあまり普通では
@@ -125,7 +127,7 @@
 
 .-.-.
 
-11 Nov.2003
+12 Oct.2004
 
 山田邦博
 YAMADA Kunihiro <king@tksa.gr.jp>
diff -ru Mkphotohtml_2.1/doc/README.jp.txt Mkphotohtml_2.2/doc/README.jp.txt
--- Mkphotohtml_2.1/doc/README.jp.txt   2004-03-05 00:19:03.000000000 +0900
+++ Mkphotohtml_2.2/doc/README.jp.txt   2004-10-12 13:58:55.000000000 +0900
@@ -5,7 +5,7 @@
 
                                山田邦博
                    YAMADA Kunihiro <king@tksa.gr.jp>
-                        5 Mar.2004 (Release 2.1)
+                        12 Oct.2004 (Release 2.2)
                     Copyright policy: GNU GPL Ver.2
 
 
@@ -74,6 +74,7 @@
 ・サブテーマとして、"http://some.domain/some/theme/" という形式の URL
   を指定する事ができるようになった。
 ・Contents.db と photo.html の文字コードを UTF-8 に統一した。
+  ただし、US-ASCII しか使われていない場合は、"us-ascii" になる。
 ・Charset 設定は、ver.1.x では出力ファイル(Contents.db と photo,html)
   の文字コードを指定したが、ver.2.0 からは記述ファイル自身(メッセージ
   ファイルと Contents.conf)の文字コードを指定する。 (UTF-8 への変換は
@@ -263,6 +264,8 @@
 (例外 -f オプション)
 
   Contents.db は UTF-8 で記述される。
+ただし、US-ASCII しか使われていない場合は、charset として "us-ascii"
+が使用される。 これは photo.html でも同じである。
 
 
 Contents.conf と Contents.db の構成 :
##### (END) cut here for documents #####

-...-

##### (BEGIN) cut here for binaries #####
#!/bin/sh
# This is a shell archive (produced by GNU sharutils 4.2.1).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `!/bin/sh' line above, then type `sh FILE'.
#
# Made on 2004-10-12 14:40 JST by <king@chiepo>.
# Source directory was `/home/king/src/image'.
#
# Existing files will *not* be overwritten unless `-c' is specified.
#
# This shar contains:
# length mode       name
# ------ ---------- ------------------------------------------
#   2529 -rw-r----- /home/king/tmp/Mkphotohtml_2.2-bin.diff
#
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
  if test "$gettext_dir" = FAILED && test -f $dir/gettext \
     && ($dir/gettext --version >/dev/null 2>&1)
  then
    set `$dir/gettext --version 2>&1`
    if test "$3" = GNU
    then
      gettext_dir=$dir
    fi
  fi
  if test "$locale_dir" = FAILED && test -f $dir/shar \
     && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
  then
    locale_dir=`$dir/shar --print-text-domain-dir`
  fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
  echo=echo
else
  TEXTDOMAINDIR=$locale_dir
  export TEXTDOMAINDIR
  TEXTDOMAIN=sharutils
  export TEXTDOMAIN
  echo="$gettext_dir/gettext -s"
fi
if touch -am -t 200112312359.59 $$.touch >/dev/null 2>&1 && test ! -f 200112312359.59 -a -f $$.touch; then
  shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am 123123592001.59 $$.touch >/dev/null 2>&1 && test ! -f 123123592001.59 -a ! -f 123123592001.5 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am 1231235901 $$.touch >/dev/null 2>&1 && test ! -f 1231235901 -a -f $$.touch; then
  shar_touch='touch -am $3$4$5$6$2 "$8"'
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 200112312359.59 123123592001.59 123123592001.5 1231235901 $$.touch
#
if mkdir _sh04226; then
  $echo 'x -' 'creating lock directory'
else
  $echo 'failed to create lock directory'
  exit 1
fi
# ============= /home/king/tmp/Mkphotohtml_2.2-bin.diff ==============
if test ! -d '/home'; then
  $echo 'x -' 'creating directory' '/home'
  mkdir '/home'
fi
if test ! -d '/home/king'; then
  $echo 'x -' 'creating directory' '/home/king'
  mkdir '/home/king'
fi
if test ! -d '/home/king/tmp'; then
  $echo 'x -' 'creating directory' '/home/king/tmp'
  mkdir '/home/king/tmp'
fi
if test -f '/home/king/tmp/Mkphotohtml_2.2-bin.diff' && test "$first_param" != -c; then
  $echo 'x -' SKIPPING '/home/king/tmp/Mkphotohtml_2.2-bin.diff' '(file already exists)'
else
  $echo 'x -' extracting '/home/king/tmp/Mkphotohtml_2.2-bin.diff' '(text)'
  sed 's/^X//' << 'SHAR_EOF' > '/home/king/tmp/Mkphotohtml_2.2-bin.diff' &&
diff -ru Mkphotohtml_2.1/bin/mkphotohtml Mkphotohtml_2.2/bin/mkphotohtml
--- Mkphotohtml_2.1/bin/mkphotohtml     2004-03-05 00:16:21.000000000 +0900
+++ Mkphotohtml_2.2/bin/mkphotohtml     2004-10-12 14:05:17.000000000 +0900
@@ -74,6 +74,7 @@
X #   18 Oct.2003   Ver.2.0-pre.04 : Released
X #   11 Nov.2003   Ver.2.0 : Released
X #    5 Mar.2004   Ver.2.1 : Released
+#   12 Oct.2004   Ver.2.2 : Released
X #
X 
X no lib qw(:ALL .);
@@ -165,7 +166,7 @@
X 
X 
X ### Constants ###
-my $VERSION = "2.1";
+my $VERSION = "2.2";
X my $WEBINFO = "http://www.tksa.gr.jp/king/Software/Mkphothtml/";
X 
X my $PFIRST = "[-_]?(?:First|1st|Fir)";
@@ -377,12 +378,15 @@
X 
X ######################################################################
X 
+$::utf8 = 0;
+
X sub is_utf8 ( $ ) {
X   my $s = shift;
X   while ($s =~ s/^(.)//s) {
X     return 0 if $1 eq "\e";      # JIS or other charset with ESC
X     my $c = ord($1);
X     next unless $c & 0x80;       # ASCII
+    $::utf8 = 1;                 # UTF-8
X     my $n;
X     if (($c & 0xe0) == 0xc0) {
X       $n = 2;
@@ -1555,6 +1559,7 @@
X     local $::opt_epilog  = $::opt_epilog;
X     local $::opt_ps      = $::opt_ps;
X     local $::opt_date    = $::opt_date;
+    local $::utf8 = 0;
X 
X     my $theTheme_on;
X     my $theTheme_theme   = get_default_theme();
@@ -2056,6 +2061,8 @@
X     $theTheme_image .= "\n\t  ($t_info_N)($t_info_H)($t_info_I)"
X        unless $theTheme_image =~ /\s/;
X 
+    my $charset = ($::utf8 ? "utf-8" : "us-ascii");
+
X     my $content_db = <<EOF;
X # $CONTENT: Do not edit this!
X # This file was generated by $PNAME at $ctime
@@ -2064,7 +2071,7 @@
X \t$PNAME $VERSION
X 
X Option:
-\tCharset=utf8
+\tCharset=$charset
X \tLanguage=$::opt_lang
X \tOrder=$::opt_order
X \tImage=$::opt_image
@@ -2127,6 +2134,12 @@
X 
X     ### Generate photo.html ###
X     my $hml = $html_message{$::opt_lang};
+    for my $i (keys %{$hml}) {
+      print "#",__LINE__,"# \$hml->{$i}=$hml->{$i}\n" if $DEBUG;
+      is_utf8($hml->{$i});
+    }
+    $charset = ($::utf8 ? "utf-8" : "us-ascii");
+    print "#",__LINE__,"# \$::utf8=$::utf8\n" if $DEBUG;
X 
X     foreach my $c (@contents) {
X       $c->{Comment} = expand_href(sanitize_meta($c->{Comment}))
@@ -2224,7 +2237,7 @@
X <html>
X   <head>
X     <META HTTP-EQUIV="Content-Type"
-             CONTENT="text/html; charset=utf-8">
+             CONTENT="text/html; charset=$charset">
X     <META NAME="GENERATOR" CONTENT="mkphotohtml V$VERSION">
X     <META NAME="Keyword" CONTENT="mkphotohtml,Network Photo Album">
X     <META NAME="Networkphotoalbum" CONTENT="$::opt_refer">
SHAR_EOF
  (set 20 04 10 12 14 40 26 '/home/king/tmp/Mkphotohtml_2.2-bin.diff'; eval "$shar_touch") &&
  chmod 0640 '/home/king/tmp/Mkphotohtml_2.2-bin.diff' ||
  $echo 'restore of' '/home/king/tmp/Mkphotohtml_2.2-bin.diff' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo '/home/king/tmp/Mkphotohtml_2.2-bin.diff:' 'MD5 check failed'
95076425f603df406e64d46d12db8106  /home/king/tmp/Mkphotohtml_2.2-bin.diff
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < '/home/king/tmp/Mkphotohtml_2.2-bin.diff'`"
    test 2529 -eq "$shar_count" ||
    $echo '/home/king/tmp/Mkphotohtml_2.2-bin.diff:' 'original size' '2529,' 'current size' "$shar_count!"
  fi
fi
rm -fr _sh04226
exit 0