diff options
author | Karl Williamson <public@khwilliamson.com> | 2013-03-13 16:14:31 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-08-29 09:56:02 -0600 |
commit | bd27cf70a027fa9035f346c80e178dd8dd9ab73e (patch) | |
tree | 7966b4dcb7f2dbc013cfe59d8e982c237725d4ea /sv.c | |
parent | 951cbe24a29fb0f0bfbe0d4022215ec9ef7a2028 (diff) | |
download | perl-bd27cf70a027fa9035f346c80e178dd8dd9ab73e.tar.gz |
sv.c: Make less ASCII-centric
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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++ = '\\'; |