File: xml.t

package info (click to toggle)
libencode-perl 3.00-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 11,164 kB
  • sloc: perl: 4,418; ansic: 1,067; makefile: 8
file content (22 lines) | stat: -rw-r--r-- 349 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;

use Encode;
use Test::More;

my $content = String->new("--\x{30c6}--");
my $text = Encode::encode('latin1', $content, Encode::FB_XMLCREF);
is $text, "--テ--";

done_testing;

package String;
use overload
  '""' => sub { ${$_[0]} }, fallback => 1;

sub new {
    my($class, $str) = @_;
    bless \$str, $class;
}

1;