--- embedaddon/pcre/pcre_ord2utf8.c 2012/02/21 23:50:25 1.1.1.2 +++ embedaddon/pcre/pcre_ord2utf8.c 2013/07/22 08:25:55 1.1.1.3 @@ -45,15 +45,16 @@ character value into a UTF8 string. */ #include "config.h" #endif +#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 @@ -62,17 +63,13 @@ Arguments: Returns: number of characters placed in the buffer */ +unsigned int PRIV(ord2utf)(pcre_uint32 cvalue, pcre_uchar *buffer) { #ifdef SUPPORT_UTF 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;