diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-16 02:45:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-12-16 02:45:06 +0000 |
commit | 9466bab696bbe701541ead3a883c2387f5110da2 (patch) | |
tree | 070a0fde8d3f0dcf9fbcc1b789f7e4ee2c1ce265 /utf8.c | |
parent | 76ccdbe266e63a2a3ac21a782e44a6b13093ac7f (diff) | |
download | perl-9466bab696bbe701541ead3a883c2387f5110da2.tar.gz |
Make creating UTF-8 surrogates a punishable act.
p4raw-id: //depot/perl@13707
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -68,6 +68,8 @@ Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) return d; } if (uv < 0x10000) { + if (UNICODE_IS_SURROGATE(uv)) + Perl_croak(aTHX_ "UTF-16 surrogate 0x%04"UVxf, uv); *d++ = (( uv >> 12) | 0xe0); *d++ = (((uv >> 6) & 0x3f) | 0x80); *d++ = (( uv & 0x3f) | 0x80); |