Parent Directory
|
Revision Log
++ whatpm/Whatpm/ChangeLog 10 Sep 2008 10:25:19 -0000 2008-09-10 Wakaba <wakaba@suika.fam.cx> * ContentChecker.pm: Support for charset-layer error levels. * HTML.pm.src: Don't specify |text| argument for the |chardecode:fallback| error, since it is not the encoding being used alternatively. ++ whatpm/Whatpm/Charset/ChangeLog 10 Sep 2008 10:26:52 -0000 2008-09-10 Wakaba <wakaba@suika.fam.cx> * DecodeHandle.pm: Set error levels. * WebLatin1.pm: Support for |us-ascii| and |iso-8859-5| charsets (this module no longer for Latin1, but for Latin* encodings). * WebThai.pm: Support for |tis-620| charset.
| 1 | wakaba | 1.1 | #!/usr/bin/perl |
| 2 | wakaba | 1.2 | package Whatpm::Charset::WebThai; |
| 3 | wakaba | 1.1 | use strict; |
| 4 | our $VERSION=do{my @r=(q$Revision: 1.1 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; | ||
| 5 | |||
| 6 | ## NOTE: This module does not expect that its standalone uses. | ||
| 7 | ## See Message::Charset::Info for how it is used. | ||
| 8 | |||
| 9 | require Encode::Encoding; | ||
| 10 | push our @ISA, 'Encode::Encoding'; | ||
| 11 | __PACKAGE__->Define (qw/web-thai/); | ||
| 12 | |||
| 13 | sub encode ($$;$) { | ||
| 14 | # $self, $str, $chk | ||
| 15 | if ($_[2]) { | ||
| 16 | if ($_[1] =~ s/^([\x00-\x7F\xA0\x{0E01}-\x{0E3A}\x{0E3F}-\x{0E5B}]+)//) { | ||
| 17 | return Encode::encode ('iso-8859-11', $1); | ||
| 18 | } else { | ||
| 19 |