Skip to content

Commit

Permalink
Fix .perl of \r\n grapheme.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Nov 4, 2015
1 parent 97047f0 commit fd3927d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/core/Str.pm
Expand Up @@ -211,7 +211,8 @@ my class Str does Stringy { # declared in BOOTSTRAP

# Under NFG-supporting implementations, must be sure that any leading
# combiners are escaped, otherwise they will be combined onto the "
# under concatenation closure, which ruins round-tripping.
# under concatenation closure, which ruins round-tripping. Also handle
# the \r\n grapheme correctly.
my $result = '"';
my $to-encode = self;

Expand All @@ -223,6 +224,10 @@ my class Str does Stringy { # declared in BOOTSTRAP
$result ~= char-to-escapes($ch);
next;
}
elsif $ch eq "\r\n" {
$result ~= '\r\n';
next;
}
#?endif
$result ~= %esc{$ch}
// (nqp::iscclass( nqp::const::CCLASS_PRINTING,
Expand Down

0 comments on commit fd3927d

Please sign in to comment.