Encode-JP-Mobile
view release on metacpan or search on metacpan
lib/Encode/JP/Mobile/Cookbook.pod view on Meta::CPAN
close $fh;
}
# DB ãªã©ããã¯æ®éã« utf-8 ã§åãåºãä»»æã®å¦çãè¡ã...
open(my $fh, '<', '/tmp/test.txt');
my $data = decode('utf-8', join "", <$fh>);
# åºåããæã¯ã端æ«ã«åãããã¨ã³ã³ã¼ãã£ã³ã°ã§ encode ãã¦ããã¾ã.
my $charset = $encoding =~ /sjis/ ? 'shift_jis' : 'utf-8';
my $html = <<HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
</head>
<body>
<form action="$ENV{SCRIPT_NAME}" method="POST">
<input type="text" name="text" />
<input type="submit">
</form>
tools/make-airh-test-html.pl view on Meta::CPAN
use strict;
use warnings;
use Encode;
my $charset = shift or die "Usage: $0 utf-8";
my $message = $charset =~ /utf-?8/i ? "ãã¼ã¦ãã¼ããµ" : encode('cp932', decode('utf-8', "ãããã"));
print <<"...";
<?xml version="1.0" encoding="$charset"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$charset" />
<title>i-mode pictogram test</title>
</head>
<body>
<p>target charset: $charset($message)</p>
<h1>docomo</h1>
<ol>
<li>uni hex cref: </li>
( run in 0.461 second using v1.01-cache-2.11-cpan-49f99fa48dc )