We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e111c14 commit 21ab8bcCopy full SHA for 21ab8bc
S15-nfg/crlf-encoding.t
@@ -0,0 +1,15 @@
1
+use v6;
2
+use Test;
3
+
4
+plan 20;
5
6
+for <utf-8 ascii latin-1 windows-1252> -> $encoding {
7
+ my $buf = "\r\n".encode($encoding);
8
+ is $buf.elems, 2, "CRLF encodes to 2 bytes ($encoding)";
9
+ is $buf[0], 0x0D, "first byte is correct ($encoding)";
10
+ is $buf[1], 0x0A, "second byte is correct ($encoding)";
11
12
+ my $str = $buf.decode($encoding);
13
+ is $str.chars, 1, "decoding it gives back one grapheme ($encoding)";
14
+ is $str, "\r\n", "decoding it gives back the correct grapheme ($encoding)";
15
+}
0 commit comments