summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-07-28 08:26:35 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2017-07-28 08:26:45 +0100
commit7e4f1950d493828a9ccdb25842eeed1823e71df8 (patch)
tree2f6b61084c802aa10ac9a4c48db231465a546cad /toke.c
parentc00934b73e0572477646e79eb4ff017452ae9d8e (diff)
downloadperl-7e4f1950d493828a9ccdb25842eeed1823e71df8.tar.gz
PATCH: [perl #128734] tr/\N{...}/ failing for 128-255
The upper latin1 characters when expressed as \N{U+...} were failing. This was due to trying to convert them to UTF-8 when the result isn't UTF-8. I added a test for \N{name} as well, though these were not affected by this regression. (cherry picked from commit 3a34ca0bce7835211b45e070373cf653c253636a)
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index 9ebfddc5ec..2cfae9fc78 100644
--- a/toke.c
+++ b/toke.c
@@ -3540,7 +3540,7 @@ S_scan_const(pTHX_ char *start)
}
/* Add the (Unicode) code point to the output. */
- if (OFFUNI_IS_INVARIANT(uv)) {
+ if (! has_utf8 || OFFUNI_IS_INVARIANT(uv)) {
*d++ = (char) LATIN1_TO_NATIVE(uv);
}
else {