diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-05 22:09:20 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-05 22:09:20 +0000 |
commit | 9e55ce066d52428ee12b0c4df544c9a64f88c082 (patch) | |
tree | 52abfa57613cd9fbb4312fee9271e6b668819233 /utf8.c | |
parent | c7bdadfda7603b18f6db06d8065ed2a479a95e76 (diff) | |
download | perl-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.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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); |