root/lang/perl/Encode-JP-Mobile/trunk/tools/make-airh-test-html.pl

Revision 6289, 1.2 kB (checked in by tomi-ru, 8 months ago)

small fix for tools/

  • Property svn:executable set to *
Line 
1use strict;
2use warnings;
3use Encode;
4
5my $charset = shift or die "Usage: $0 utf-8";
6
7my $message = $charset =~ /utf-?8/i ? "ゆーてぃーえふ" : encode('cp932', decode('utf-8', "えすじす"));
8
9print <<"...";
10<?xml version="1.0" encoding="$charset"?>
11<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
12<html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml">
13<head>
14    <meta http-equiv="Content-Type" content="text/html; charset=$charset" />
15    <title>i-mode pictogram test</title>
16</head>
17<body>
18<p>target charset: $charset($message)</p>
19<h1>docomo</h1>
20<ol>
21    <li>uni hex cref: &#xE63E;</li>
22    <li>uni dec cref: &#58942;</li>
23    <li>utf8 binary: @{[ encode 'utf-8', "\x{E63E}" ]}</li>
24    <li>sjis hex cref: &#xF89F;</li>
25    <li>sjis dec cref: &#x63647;</li>
26    <li>sjis binary: \xF8\x9F</li>
27</ol>
28
29<p>target charset: $charset($message)</p>
30<h1>airh</h1>
31<ol>
32    <li>uni hex cref: &#xE093;</li>
33    <li>uni dec cref: &#57491;</li>
34    <li>utf8 binary: @{[ encode 'utf-8', "\x{E093}" ]}</li>
35    <li>sjis hex cref: &#xF0D4;</li>
36    <li>sjis dec cref: &#@{[ 0xF0D4 ]};</li>
37    <li>sjis binary: \xF0\xD4</li>
38</ol>
39
40</body>
41</html>
42...
43
Note: See TracBrowser for help on using the browser.