diff options
author | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:56:22 +0000 |
---|---|---|
committer | chpe <chpe@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2012-10-16 15:56:22 +0000 |
commit | f4551b3ba82aff87a520b041b9e1dc1fe1ec5533 (patch) | |
tree | c03d7a438a26e93751fc67f2909a08038b7b20d0 /pcre_ord2utf8.c | |
parent | 079e382d01f40c050c4ca2d6d43dddb097a5c08e (diff) | |
download | pcre-f4551b3ba82aff87a520b041b9e1dc1fe1ec5533.tar.gz |
pcre32: utf: Remove unused replacement in PRIV(ord2utf)
The code replaced surrogates and characters > 10ffff with fffe, for no apparent
reason. Taking this code out still lets the test suite pass. We cannot assert
however that the character is a valid unicode character since we do need to handle
e.g. 10ffff here.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1099 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'pcre_ord2utf8.c')
-rw-r--r-- | pcre_ord2utf8.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/pcre_ord2utf8.c b/pcre_ord2utf8.c index 50fca95..3872fe9 100644 --- a/pcre_ord2utf8.c +++ b/pcre_ord2utf8.c @@ -45,15 +45,16 @@ character value into a UTF8 string. */ #include "config.h" #endif -#include "pcre_internal.h" +#define COMPILE_PCRE8 +#include "pcre_internal.h" /************************************************* * Convert character value to UTF-8 * *************************************************/ /* This function takes an integer value in the range 0 - 0x10ffff -and encodes it as a UTF-8 character in 1 to 6 pcre_uchars. +and encodes it as a UTF-8 character in 1 to 4 pcre_uchars. Arguments: cvalue the character value @@ -69,11 +70,6 @@ PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer) register int i, j; -/* Checking invalid cvalue character, encoded as invalid UTF-16 character. -Should never happen in practice. */ -if ((cvalue & 0xf800) == 0xd800 || cvalue >= 0x110000) - cvalue = 0xfffe; - for (i = 0; i < PRIV(utf8_table1_size); i++) if ((int)cvalue <= PRIV(utf8_table1)[i]) break; buffer += i; |