summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2013-03-13 16:14:31 -0600
committerKarl Williamson <public@khwilliamson.com>2013-08-29 09:56:02 -0600
commitbd27cf70a027fa9035f346c80e178dd8dd9ab73e (patch)
tree7966b4dcb7f2dbc013cfe59d8e982c237725d4ea /sv.c
parent951cbe24a29fb0f0bfbe0d4022215ec9ef7a2028 (diff)
downloadperl-bd27cf70a027fa9035f346c80e178dd8dd9ab73e.tar.gz
sv.c: Make less ASCII-centric
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sv.c b/sv.c
index 632d1dcb72..41764714a4 100644
--- a/sv.c
+++ b/sv.c
@@ -1749,10 +1749,12 @@ S_sv_display(pTHX_ SV *const sv, char *tmpbuf, STRLEN tmpbuf_size) {
const char * const end = s + SvCUR(sv);
for ( ; s < end && d < limit; s++ ) {
int ch = *s & 0xFF;
- if (ch & 128 && !isPRINT_LC(ch)) {
+ if (! isASCII(ch) && !isPRINT_LC(ch)) {
*d++ = 'M';
*d++ = '-';
- ch &= 127;
+
+ /* Map to ASCII "equivalent" of Latin1 */
+ ch = LATIN1_TO_NATIVE(NATIVE_TO_LATIN1(ch) & 127);
}
if (ch == '\n') {
*d++ = '\\';