Bug 10120: DBRev 3.13.00.006
[koha.git] / t / Charset.t
blob7de3414a85ba38f8c42cf3e086989f0bd12af5ce
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use Test::More tests => 6;
7 BEGIN {
8 use_ok('C4::Charset');
11 my $octets = "abc";
12 ok(IsStringUTF8ish($octets), "verify octets are valid UTF-8 (ASCII)");
14 $octets = "flamb\c3\a9";
15 ok(!utf8::is_utf8($octets), "verify that string does not have Perl UTF-8 flag on");
16 ok(IsStringUTF8ish($octets), "verify octets are valid UTF-8 (LATIN SMALL LETTER E WITH ACUTE)");
17 ok(!utf8::is_utf8($octets), "verify that IsStringUTF8ish does not magically turn Perl UTF-8 flag on");
19 $octets = "a\xc2" . "c";
20 ok(!IsStringUTF8ish($octets), "verify octets are not valid UTF-8");