NAME HP15 - "Yet Another JPerl" Source code filter for HP-15 script SYNOPSIS In your script: use HP15; At command prompt: perl.exe yourscript.pl wild* *card and '*quote*' are ok ... perl58 yourscript.pl wild* *card and '*quote*' are ok ... perl510 yourscript.pl wild* *card and '*quote*' are ok ... DESCRIPTION This software is "Yet Another JPerl" written by Perl. We can write the script in HP-15. This software treats HP-15 directly. Therefore, there is not UTF8 flag. INSTALLATION To install this software, type the following: perl Makefile.PL --- Makefile.PL makes "make.bat" only, and ... make.bat make.bat test make.bat install --- install to current using Perl perl58 make.bat install --- install to Perl5.8 perl510 make.bat install --- install to Perl5.10 MAKE OTHER make.bat dist --- make distribution package make.bat tar.bat --- make perl script "tar.bat" PROGRAM COMPOSITION HP15.pm --- source code filter for HP-15 script Ehp15.pm --- run-time routines for HP15.pm perl58.bat --- find and run perl5.8 without %PATH% settings perl510.bat --- find and run perl5.10 without %PATH% settings DEPENDENCIES This software requires perl5.00503 or later. LICENSE AND COPYRIGHT This software is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic. This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MAINTAINER This project was originated by INABA Hitoshi . HP-15 in Understanding Japanese Information Processing Hewlett-Packard developed Japanese encoding methods called HP-15. HP-15 is a superset of ShiftJIS encoding -- all the standard ShiftJIS code positions fall entirely into the HP-15 code space. Hewlett-Packard defines HP-15 as a series of four encoding blocks, but this can be simplified into two ranges for both octets. These ranges include a user-defined character area that falls at the outskirts of the standard ShiftJIS encoding space. * ALGORITHM #1 When the character is taken out of the octet string, it is necessary to distinguish a single octet character and the double octet character. The distinction is done only by first octet. Single octet code is: 0x00-0x7F, 0xA1-0xDF and 0xFF Double octet code is: First octet 0x80-0xA0 and 0xE0-0xFE Second octet 0x00-0xFF (All octet) MALFORMED single octet code is: 0x80-0xA0 and 0xE0-0xFE * Final octet of string like first octet of double octet code See also code table: Single octet code 0 1 2 3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-+-+-+-+-+-+-+-+-+-+-+-+-+-+ F| | | | | | | | | | | | | | | |*| 0xFF +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Double octet code First octet Second octet 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0| | | | | | | | | | | | | | | | | 0|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| 0x00-0xFF +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1| | | | | | | | | | | | | | | | | 1|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2| | | | | | | | | | | | | | | | | 2|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3| | | | | | | | | | | | | | | | | 3|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4| | | | | | | | | | | | | | | | | 4|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5| | | | | | | | | | | | | | | | | 5|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6| | | | | | | | | | | | | | | | | 6|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-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*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ F|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| | F|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ *MALFORMED* Single octet code Final octet of string like first octet of double octet code Even if malformed, it is not ignored and not deleted automatically. For example, Esjis::chop function returns this octet. 0 1 2 3 4 5 6 7 8 9 A B C D E F +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 7| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 8|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M| 0x80-0xA0 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 9|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ A|M| | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ B| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ C| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ D| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ E|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M| 0xE0-0xFE +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ F|M|M|M|M|M|M|M|M|M|M|M|M|M|M|M| | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * ALGORITHM #2 Against algorithm.1, when the range of the character by tr/// is specified, only the following character codes are effective. Single octet code is: 0x00-0x7F, 0xA1-0xDF and 0xFF Double octet code is: First octet 0x80-0xA0 and 0xE0-0xFE Second octet 0x21-0x7E and 0x80-0xFF For instance, [\x81\x00-\x82\xFF] in script means [\x81\x82][\x21-\x7E\x80-\xFF]. See also code table: Single octet code 0 1 2 3 4 5 6 7 8 9 A B C D E F +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| 0x00-0x7F +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 4|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 5|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 6|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 7|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 8| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 9| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ A| |*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| 0xA1-0xDF +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ B|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ C|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ D|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ E| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ F| | | | | | | | | | | | | | | |*| 0xFF +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Double octet code First octet Second octet 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 0| | | | | | | | | | | | | | | | | 0| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 1| | | | | | | | | | | | | | | | | 1| | | | | | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2| | | | | | | | | | | | | | | | | 2| |*|*|*|*|*|*|*|*|*|*|*|*|*|*|*| 0x21-0x7E +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 3| | | | | | | | | | | | | | | | | 3|*|*|*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