File: 111fieldu-full_ru.t

package info (click to toggle)
libmail-message-perl 3.017-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,632 kB
  • sloc: perl: 11,156; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 738 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
23
24
25
#!/usr/bin/env perl
#
# Test processing of full fields with russian chars in utf-8.
#

use strict;
use warnings;
use utf8;

use Mail::Message::Test;
use Mail::Message::Field::Structured;

use Test::More tests => 3;

my $mmfs = 'Mail::Message::Field::Structured';

my $r = $mmfs->new('r', '');
isa_ok($r, $mmfs);

my $text_ru =
  "Раньше длинные multibyte-последовательности кодировались неправильно, теперь должно работать.";
is($r->decode($r->encode($text_ru, charset => 'utf-8', encoding => 'q')),
    $text_ru, 'encode/decode to/from QP');
is($r->decode($r->encode($text_ru, charset => 'utf-8', encoding => 'b')),
    $text_ru, 'encode/decode to/from Base64');