dmitry Fri Sep 10 05:00:32 2004 EDT Modified files: (Branch: PHP_5_0) /php-src/ext/soap php_encoding.c Log: Using php_libxml_xmlCheckUTF8() from ext/libxml. http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.71.2.4&r2=1.71.2.5&ty=u Index: php-src/ext/soap/php_encoding.c diff -u php-src/ext/soap/php_encoding.c:1.71.2.4 php-src/ext/soap/php_encoding.c:1.71.2.5 --- php-src/ext/soap/php_encoding.c:1.71.2.4 Tue Sep 7 10:41:29 2004 +++ php-src/ext/soap/php_encoding.c Fri Sep 10 05:00:32 2004 @@ -17,11 +17,12 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: php_encoding.c,v 1.71.2.4 2004/09/07 14:41:29 dmitry Exp $ */ +/* $Id: php_encoding.c,v 1.71.2.5 2004/09/10 09:00:32 dmitry Exp $ */ #include <time.h> #include "php_soap.h" +#include "ext/libxml/php_libxml.h" /* zval type decode */ static zval *to_zval_double(encodeTypePtr type, xmlNodePtr data); @@ -581,32 +582,6 @@ return ret; } -static int php_soap_xmlCheckUTF8(const unsigned char *s) -{ - int i; - unsigned char c; - - for (i = 0; (c = s[i++]);) { - if ((c & 0x80) == 0) { - } else if ((c & 0xe0) == 0xc0) { - if ((s[i++] & 0xc0) != 0x80) { - return 0; - } - } else if ((c & 0xf0) == 0xe0) { - if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) { - return 0; - } - } else if ((c & 0xf8) == 0xf0) { - if ((s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80 || (s[i++] & 0xc0) != 0x80) { - return 0; - } - } else { - return 0; - } - } - return 1; -} - static xmlNodePtr to_xml_string(encodeTypePtr type, zval *data, int style, xmlNodePtr parent) { xmlNodePtr ret; @@ -638,12 +613,12 @@ efree(str); str = estrdup(xmlBufferContent(out)); new_len = n; - } else if (!php_soap_xmlCheckUTF8(str)) { + } else if (!php_libxml_xmlCheckUTF8(str)) { soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str); } xmlBufferFree(out); xmlBufferFree(in); - } else if (!php_soap_xmlCheckUTF8(str)) { + } else if (!php_libxml_xmlCheckUTF8(str)) { soap_error1(E_ERROR, "Encoding: string '%s' is not a valid utf-8 string", str); }
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php