Home
last modified time | relevance | path

Searched refs:encode (Results 1 – 25 of 430) sorted by relevance

12345678910>>...18

/openbsd/gnu/usr.bin/perl/t/op/
H A Dutftaint.t29 my $encode = $ary->[0];
63 my $encode = $ary->[0];
69 utf8::encode($taint);
71 is($taint, $byte, "compare: $encode, encode utf8");
82 is($taint, $utf8, "compare: $encode, decode byte");
86 is(is_utf8($taint), ($encode ne 'ascii'), "is_utf8: $encode, decode byte");
93 my $encode = $ary->[0];
101 is($taint, $up, "compare: $encode, upgrade up");
105 ok(is_utf8($taint), "is_utf8: $encode, upgrade up");
112 is($taint, $up, "compare: $encode, upgrade down");
[all …]
/openbsd/gnu/usr.bin/perl/cpan/JSON-PP/t/
H A D020_unknown.t12 eval q| $json->encode( [ sub {} ] ) |;
15 eval q| $json->encode( [ \-1 ] ) |;
16 ok( $@ =~ /cannot encode reference to scalar/, $@ );
18 eval q| $json->encode( [ \undef ] ) |;
21 eval q| $json->encode( [ \{} ] ) |;
26 is( $json->encode( [ sub {} ] ), '[null]' );
27 is( $json->encode( [ \-1 ] ), '[null]' );
28 is( $json->encode( [ \undef ] ), '[null]' );
29 is( $json->encode( [ \{} ] ), '[null]' );
37 eval q| $json->encode( [ $fh ] ) |;
[all …]
H A D109_encode.t19 is($json->encode("¶"), q|"¶"|); # as is
23 is($json->encode("\xb6"), q|"\u00b6"|); # latin1
26 is($json->encode("\xc2\xb6"), q|"\u00c2\u00b6"|); # utf8
27 is($json->encode("¶"), q|"\u00c2\u00b6"|); # utf8
28 is($json->encode('あ'), q|"\u00e3\u0081\u0082"|);
32 is($json->encode("\x80\x65"), q|"\u0080\u0065"|); # utf8
33 is($json->encode("¶"), q|"\u0080\u0065"|); # utf8
36 is($json->encode("\x78\x64"), q|"\u0078\u0064"|); # utf8
40 is($json->encode('あ'), (q|"\u00ce\u0043\u0043"|));
43 is($json->encode(chr hex 3042 ), q|"\u3042"|);
[all …]
H A D008_pc_base.t20 $js = $pc->encode($obj);
25 $js = $pc->encode($obj);
32 $js = $pc->encode($obj);
37 $js = $pc->encode($obj);
42 $js = $pc->encode($obj);
47 $js = $pc->encode($obj);
53 $js = $pc->encode($obj);
59 $js = $pc->encode($obj);
65 $js = $pc->encode($obj);
70 $js = $pc->encode($obj);
[all …]
H A D007_pc_esc.t23 $str = $pc->encode($obj);
27 $str = $pc->encode($obj);
37 $str = $pc->encode($obj);
41 $str = $pc->encode($obj);
45 $str = $pc->encode($obj);
49 $str = $pc->encode($obj);
53 $str = $pc->encode($obj);
57 $str = $pc->encode($obj);
61 $str = $pc->encode($obj);
65 $str = $pc->encode($obj);
[all …]
H A D006_pc_pretty.t17 $js = $pc->encode($obj);
22 $js = $pc->encode($obj);
34 $js = $pc->encode($obj);
40 $js = $pc->encode($obj);
55 $js = $pc->encode($obj);
61 is($pc->encode($obj), qq|{\n "foo":"bar"\n}\n|, "nospace");
63 is($pc->encode($obj), qq|{\n "foo": "bar"\n}\n|, "after");
65 is($pc->encode($obj), qq|{\n "foo" : "bar"\n}\n|, "both");
67 is($pc->encode($obj), qq|{\n "foo" :"bar"\n}\n|, "before");
H A D002_error.t15 eval { JSON::PP->new->encode ([\-1]) }; ok $@ =~ /cannot encode reference/;
16 eval { JSON::PP->new->encode ([\undef]) }; ok $@ =~ /cannot encode reference/;
17 eval { JSON::PP->new->encode ([\2]) }; ok $@ =~ /cannot encode reference/;
18 eval { JSON::PP->new->encode ([\{}]) }; ok $@ =~ /cannot encode reference/;
19 eval { JSON::PP->new->encode ([\[]]) }; ok $@ =~ /cannot encode reference/;
20 eval { JSON::PP->new->encode ([\\1]) }; ok $@ =~ /cannot encode reference/;
H A D099_binary.pl24 $js = JSON::PP->new->allow_nonref(0)->utf8->ascii->shrink->encode ([$_[0]]);
26 $js = JSON::PP->new->allow_nonref(0)->utf8->ascii->encode ([$_[0]]);
29 $js = JSON::PP->new->allow_nonref(0)->utf8->shrink->encode ([$_[0]]);
31 $js = JSON::PP->new->allow_nonref(1)->utf8->encode ([$_[0]]);
34 $js = JSON::PP->new->allow_nonref(1)->ascii->encode ([$_[0]]);
36 $js = JSON::PP->new->allow_nonref(0)->ascii->encode ([$_[0]]);
39 $js = JSON::PP->new->allow_nonref(1)->shrink->encode ([$_[0]]);
41 $js = JSON::PP->new->allow_nonref(0)->encode ([$_[0]]);
H A D012_blessed.t22 eval { $js->encode ($o1) }; ok ($@ =~ /allow_blessed/);
23 eval { $js->encode ($o2) }; ok ($@ =~ /allow_blessed/);
25 ok ($js->encode ($o1) eq "null");
26 ok ($js->encode ($o2) eq "null");
28 ok ($js->encode ($o1) eq '{"__":""}');
29 ok ($js->encode ($o2) eq "null");
H A D011_pc_expo.t19 $js = $pc->encode($obj);
26 $js = $pc->encode($obj);
33 $js = $pc->encode($obj);
40 $js = $pc->encode($obj);
50 $js = $pc->encode($obj);
56 $js = $pc->encode($obj);
H A D020_faihu.t11 use Encode qw(encode decode);
18 $faihu_json = $js->encode($faihu);
23 $faihu_json = $js->encode ($faihu);
28 $faihu_json = encode 'UTF-16BE', $js->encode ($faihu);
/openbsd/gnu/usr.bin/perl/cpan/Encode/t/
H A Dutf32warnings.t26 …is($warn, undef, "Calling encode on UTF32-LE encode object with valid string produces no warnings"…
27 …is($ret, $valid, "Calling encode on UTF32-LE encode object with valid string returns correct outpu…
34 …like($warn, qr/UTF-16 surrogate.* at $script line /, "Calling encode on UTF32-LE encode object wit…
41 …is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warn…
48 …is($warn, undef, "Warning from encode method of UTF32-LE encode object can be silenced via no warn…
54 $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC );
55 …arn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode objec…
61 $enc->encode( "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC );
62 …arn, qr/UTF-16 surrogate.* at $script line /, "Warning from encode method of UTF32-LE encode objec…
98 Encode::encode( $enc, "\x{D800}", Encode::WARN_ON_ERR | Encode::LEAVE_SRC );
[all …]
H A Dfallback.t57 my $dst = $ascii->encode($src, FB_DEFAULT);
87 $dst = $ascii->encode($src, FB_QUIET);
101 $dst = $ascii->encode($src, FB_WARN);
129 $dst = $ascii->encode($src, FB_PERLQQ);
130 is($dst, $ap, "FB_PERLQQ encode");
139 $dst = $ascii->encode($src, FB_HTMLCREF);
140 is($dst, $ah, "FB_HTMLCREF encode");
149 $dst = $ascii->encode($src, FB_XMLCREF);
150 is($dst, $ax, "FB_XMLCREF encode");
160 is($dst, $ac, "coderef encode");
[all …]
H A DUnicode.t24 use Encode qw(encode decode find_encoding);
58 is($n_16be, encode('UTF-16BE', $nasty), qq{encode UTF-16BE});
59 is($n_16le, encode('UTF-16LE', $nasty), qq{encode UTF-16LE});
60 is($n_32be, encode('UTF-32BE', $nasty), qq{encode UTF-32BE});
61 is($n_32le, encode('UTF-32LE', $nasty), qq{encode UTF-16LE});
68 is($n_16bb, encode('UTF-16', $nasty), qq{encode UTF-16});
69 is($n_32bb, encode('UTF-32', $nasty), qq{encode UTF-32});
81 is(encode('UCS-2BE', $nasty), $f_16be, "encode UCS-2BE: fallback");
82 is(encode('UCS-2LE', $nasty), $f_16le, "encode UCS-2LE: fallback");
83 eval { encode('UCS-2BE', $nasty, 1) };
[all …]
H A DEncode.t18 use Encode qw(from_to encode decode
34 my $uni = $sym->decode(encode(ascii => 'a'));
36 $str = $sym->encode("\N{Beta}");
45 $cpy = $tab->encode($uni);
119 is encode('utf8',$c),$o,"utf8 encode by name broken for $i";
143 ok(encode(utf8 => Encode::Dummy->new("foobar")), "foobar");
153 encode($name, $kopy, Encode::FB_CROAK);
175 $enc->encode($kopy, Encode::FB_CROAK);
180 $enc->encode($kopy, Encode::FB_CROAK | Encode::LEAVE_SRC);
197 is $latin1->encode($1), $orig, '[cpan #115168] passing magic regex globals to encode';
[all …]
H A Dguess.t17 use Encode qw(decode encode find_encoding _utf8_off);
27 my $utf16 = encode('UTF-16', $utf8on);
28 my $utf32 = encode('UTF-32', $utf8on);
54 my $test = encode($jp, $utf8on);
59 eval{ encode('Guess', $utf8on) };
60 like($@, qr/not defined/io, "no encode()");
65 my $euc_jp = my $euc_jp_clone = encode('euc-jp', $utf8on);
88 my $test = encode($name, decode('utf8', $utf8off));
96 my $test = encode("$utf$bl" => $english);
101 my $test = encode("UTF-16$bl" => $ambiguous);
[all …]
H A Dgsm0338.t60 is encode( "gsm0338", $u, $chk ), $c, sprintf( "encode %s", eu($u) );
61 eval { encode( "gsm0338", $u . "\x{3000}", $chk | Encode::FB_CROAK ) };
72 is encode( "gsm0338", $unesc_seq{$ecs}, $chk ), $ecs,
73 sprintf( "ESC: encode %s ", eu( $unesc_seq{$ecs} ) );
84 is encode("gsm0338", chr(0xC7)) => "\x09", 'RT75670: encode';
87 is decode("gsm0338", encode('gsm0338', '..@@..')), '..@@..';
88 is decode("gsm0338", encode('gsm0338', '..@€..')), '..@€..';
H A Dundef.t6 use Encode qw(encode decode find_encoding);
21 is($enc->encode(undef), undef, "find_encoding('$name')->encode(undef) returns undef");
23 is(encode($name, undef), undef, "encode('$name', undef) returns undef");
H A Ddecode.t48 is($latin1->encode($1), "\x80", 'passing magic regex to latin1 encode');
75 is(Encode::encode('utf-8', $1), "\xC3\x80", 'passing magic regex to UTF-8 encode');
82 is($latin1->encode(*a), "*main::\x80", 'passing typeglob to latin1 encode');
90 is(Encode::encode('utf-8', *a), "*main::\xC3\x80", 'passing typeglob to UTF-8 encode');
H A Drt85489.t29 ok !Encode::is_utf8($str), "UTF8 flag is not set on input string before ascii encode";
30 $ascii->encode($str);
31 ok !Encode::is_utf8($str), "UTF8 flag is not set on input string after ascii encode";
34 ok !Encode::is_utf8($str), "UTF8 flag is not set on input string before Encode::encode ascii";
35 Encode::encode("ascii", $str);
36 ok !Encode::is_utf8($str), "UTF8 flag is not set on input string after Encode::encode ascii";
/openbsd/gnu/llvm/clang/tools/scan-build-py/tests/unit/
H A Dtest_shell.py14 self.assertEqual(sut.encode(sut.decode(value)), value)
22 self.assertEqual(sut.decode(sut.encode(value)), value)
32 self.assertEqual(sut.encode(['clang', "it's me", 'again']),
34 self.assertEqual(sut.encode(['clang', "it(s me", 'again)']),
36 self.assertEqual(sut.encode(['clang', 'redirect > it']),
38 self.assertEqual(sut.encode(['clang', '-DKEY="VALUE"']),
40 self.assertEqual(sut.encode(['clang', '-DKEY="value with spaces"']),
/openbsd/gnu/llvm/lldb/third_party/Python/module/progress/
H A Dprogress.py23 light_block = chr(0x2591).encode("utf-8")
24 solid_block = chr(0x2588).encode("utf-8")
25 solid_right_arrow = chr(0x25BA).encode("utf-8")
31 fill=chr(0x25C9).encode("utf-8"),
32 blank=chr(0x25CC).encode("utf-8"),
33 marker=chr(0x25CE).encode("utf-8"),
93 fill=chr(0x25C9).encode("utf-8"),
94 blank=chr(0x25CC).encode("utf-8"),
95 marker=chr(0x25CE).encode("utf-8"),
131 fill=chr(0x25C9).encode("utf-8"),
[all …]
/openbsd/gnu/usr.bin/perl/cpan/Encode/lib/Encode/MIME/
H A DHeader.pm14 encode => 'B', # encode with 'B' or 'Q' ?
35 encode => 'Q',
212 sub encode($$;$) { subroutine
252 my $seq = $enc->encode($chr, $enc_chk);
271 my $encode = $obj->{encode};
272 my $text = $encode eq 'B' ? _encode_b($octets) : _encode_q($octets);
273 return "=?$charset?$encode?$text?=";
279 my $encode = $obj->{encode};
280 my $text_len = $encode eq 'B' ? _encoded_b_len($octets) : _encoded_q_len($octets);
281 return length("=?$charset?$encode??=") + $text_len;
[all …]
/openbsd/gnu/usr.bin/gcc/gcc/testsuite/objc/execute/
H A Dencode-1.m6 /* Test very simple @encode */
10 if (strcmp ("i", @encode (int)))
15 if (strcmp ("@", @encode (id)))
20 if (strcmp ("@", @encode (Object *)))
25 if (strcmp (":", @encode (SEL)))
/openbsd/gnu/usr.bin/perl/cpan/MIME-Base64/t/
H A Dunicode.t22 my $tmp = MIME::Base64::encode(v300);
29 my $tmp = MIME::QuotedPrint::encode(v300);
40 ok(MIME::Base64::encode($str, ""), "YWFh");
42 ok(MIME::QuotedPrint::encode($str), "aaa=\n");
47 ok(MIME::Base64::encode($str, ""), "YWFh");

12345678910>>...18