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: &#xE63E;</li>



( run in 0.461 second using v1.01-cache-2.11-cpan-49f99fa48dc )