[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3master/usr/src/Encode-compat-0.05/t/ -> 1-basic.t (source)

   1  #!/usr/bin/perl -w
   2  # $File: //member/autrijus/Encode-compat/t/1-basic.t $ $Author: autrijus $
   3  # $Revision: #3 $ $Change: 1122 $ $DateTime: 2002/10/01 01:40:18 $
   4  
   5  use strict;
   6  use Test;
   7  
   8  BEGIN { plan tests => 8 }
   9  
  10  ok(eval { use Encode::compat; 1 });
  11  
  12  use Encode qw(decode from_to is_utf8 FB_HTMLCREF);
  13  
  14  my $text = '°ŽŠ[';
  15  
  16  ok(!is_utf8($text));
  17  ok(length(decode(big5 => $text)), 2);
  18  ok(is_utf8(decode(big5 => $text)));
  19  
  20  from_to($text, 'big5eten' => 'utf8');
  21  ok(!is_utf8($text));
  22  ok(length($text), 6);
  23  
  24  from_to($text, 'utf-8' => 'latin1', FB_HTMLCREF);
  25  ok(!is_utf8($text));
  26  ok($text, '乾坤');
  27  
  28  __END__


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1