summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-05 22:09:20 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-05 22:09:20 +0000
commit9e55ce066d52428ee12b0c4df544c9a64f88c082 (patch)
tree52abfa57613cd9fbb4312fee9271e6b668819233 /utf8.c
parentc7bdadfda7603b18f6db06d8065ed2a479a95e76 (diff)
downloadperl-9e55ce066d52428ee12b0c4df544c9a64f88c082.tar.gz
Finish up (ha!) the Unicode case folding;
enhance regex dumping code. p4raw-id: //depot/perl@14096
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/utf8.c b/utf8.c
index 93c112837b..0a25c03c31 100644
--- a/utf8.c
+++ b/utf8.c
@@ -1663,7 +1663,8 @@ Perl_utf8n_to_uvchr(pTHX_ U8 *s, STRLEN curlen, STRLEN *retlen, U32 flags)
Build to the scalar dsv a displayable version of the string spv,
length len, the displayable version being at most pvlim bytes long
(if longer, the rest is truncated and "..." will be appended).
-The flags argument is currently unused but available for future extensions.
+The flags argument can have UNI_DISPLAY_ISPRINT set to display
+isprint() characters as themselves.
The pointer to the PV of the dsv is returned.
=cut */
@@ -1681,7 +1682,10 @@ Perl_pv_uni_display(pTHX_ SV *dsv, U8 *spv, STRLEN len, STRLEN pvlim, UV flags)
break;
}
u = utf8_to_uvchr((U8*)s, 0);
- Perl_sv_catpvf(aTHX_ dsv, "\\x{%"UVxf"}", u);
+ if ((flags & UNI_DISPLAY_ISPRINT) && u < 256 && isprint(u))
+ Perl_sv_catpvf(aTHX_ dsv, "%c", u);
+ else
+ Perl_sv_catpvf(aTHX_ dsv, "\\x{%"UVxf"}", u);
}
if (truncated)
sv_catpvn(dsv, "...", 3);