* Makefile: Files under the EASTASIA directory were moved to the
[elisp/non-jisx0208.git] / decode_sjis
1 #!/usr/local/bin/perl
2
3 require 'jcode.pl';
4
5 while(<>) {
6   next unless /^0x([0-9A-F]{4})\s/;
7   $data = pack('H*', $1);
8   next unless $data =~ /[\x81-\x9f\xe0-\xef][\x40-\x7e\x80-\xfc]/;
9   &jcode::convert(\$data, 'euc', 'sjis');
10   $data =~ tr/\x80-\xff/\x00-\x7f/;
11   printf "0x%s\t$_", unpack('H*', $data);
12 }