NAME
HP15 - Source code filter for HP-15 script (Imitation JPerl)
SYNOPSIS
In your script:
use HP15;
At command prompt:
perl yourscript.pl wild* *card and '*quote*' on MSWin32
DESCRIPTION
This software is "JPerl on the Modern Perl" written by Perl.
We can write the script in HP-15.
This software treats HP-15 directly. Therefore, there is not UTF8 flag.
INSTALLATION BY MAKE (for UNIX like system)
To install this software by make, type the following:
perl Makefile.PL
make
make test
make install
INSTALLATION WITHOUT MAKE (for DOS like system)
To install this software without make, type the following:
perl pMakefile.PL --- pMakefile.PL makes "pmake.bat" only, and ...
pmake.bat
pmake.bat test
pmake.bat install --- install to current using Perl
pmake.bat dist --- make distribution package
pmake.bat ptar.bat --- make perl script "ptar.bat"
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 <ina@cpan.org>.
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 4 5 6 7 8 9 A B C D E F
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
0|*|*|*|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+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
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, Ehp15::chop subroutine 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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