From: Michael Wallner Date: Tue, 17 Feb 2015 13:02:55 +0000 (+0100) Subject: test 4-byte sequences X-Git-Tag: RELEASE_2_3_0_RC1~10 X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=commitdiff_plain;h=950caf6998d2324cb98d795ea0957175f08984b8 test 4-byte sequences --- diff --git a/php_http_utf8.h b/php_http_utf8.h index d67910f..2503f06 100644 --- a/php_http_utf8.h +++ b/php_http_utf8.h @@ -555,7 +555,7 @@ static inline size_t utf8towc(unsigned *wc, const unsigned char *uc, size_t len) { unsigned char ub = utf8_mblen[*uc]; - if (!ub || ub > len || ub > 3) { + if (!ub || ub > len || ub > 4) { return 0; } diff --git a/tests/urlparser010.phpt b/tests/urlparser010.phpt index 71f6943..ae63ae7 100644 --- a/tests/urlparser010.phpt +++ b/tests/urlparser010.phpt @@ -1,19 +1,24 @@ --TEST-- -url parser multibyte/utf-8/topct +url parser multibyte/locale/topct --SKIPIF-- --FILE-- DONE @@ -27,7 +32,7 @@ object(http\Url)#%d (8) { ["pass"]=> string(12) "pa%C3%9Fwort" ["host"]=> - string(11) "sörver.net" + string(15) "𐌀𐌁𐌂.it" ["port"]=> NULL ["path"]=> diff --git a/tests/urlparser011.phpt b/tests/urlparser011.phpt new file mode 100644 index 0000000..5dbd82a --- /dev/null +++ b/tests/urlparser011.phpt @@ -0,0 +1,40 @@ +--TEST-- +url parser multibyte/utf-8/topct +--SKIPIF-- + +--FILE-- + +DONE +--EXPECTF-- +Test +object(http\Url)#%d (8) { + ["scheme"]=> + string(4) "http" + ["user"]=> + string(4) "mike" + ["pass"]=> + string(12) "pa%C3%9Fwort" + ["host"]=> + string(15) "𐌀𐌁𐌂.it" + ["port"]=> + NULL + ["path"]=> + string(15) "/for/%E2%82%AC/" + ["query"]=> + string(9) "by=%C2%A2" + ["fragment"]=> + string(6) "%C3%B8" +} +DONE