@echo off
rem $Id: convert.bat,v 1.1 2017-04-18 17:58:28+09 shige Exp $
rem 日本語変換用のバッチファイル 04/15 2017
rem   styles/{japanese.pin,ascmac.pin},
rem   latex2html.pin, l2h-init-jp.pin
rem   README*
rem これも、PERL の path を config とかで作るようにするか。

rem set PERL=C:\texlive\2016\tlpkg\tlperl\bin\perl
set PERL=perl
set script=config\encodeconv.pl

if "%1"=="" goto usage
if "%1"=="UTF8" goto utf8
if "%1"=="utf8" goto utf8

if "%1"=="SJIS" goto sjis
if "%1"=="sjis" goto sjis

:usage
echo Usage: convert.bat [encode]
echo  [encode]: utf8 or sjis
exit /b

:utf8
%PERL% %script% utf8 < styles/japanese.pin > styles/japanese.perl
%PERL% %script% utf8 < styles/ascmac.pin > styles/ascmac.perl
if not exist latex2html.org copy latex2html.pin latex2html.org
%PERL% %script% utf8 < latex2html.org > latex2html.pin
%PERL% %script% utf8 < l2h-init-jp.pin > l2h-init-jp
exit /b

:sjis
%PERL% %script% sjis < styles/japanese.pin > styles/japanese.perl
%PERL% %script% sjis < styles/ascmac.pin > styles/ascmac.perl
if not exist latex2html.org copy latex2html.pin latex2html.org
%PERL% %script% sjis < latex2html.org > latex2html.pin
%PERL% %script% sjis < l2h-init-jp.pin > l2h-init-jp
exit /b