[wp-trac] [WordPress Trac] #6690: utf8_uri_encode test data
includes BOM caused test failure
WordPress Trac
wp-trac at lists.automattic.com
Sat Apr 12 04:16:20 GMT 2008
#6690: utf8_uri_encode test data includes BOM caused test failure
---------------------+------------------------------------------------------
Reporter: akky | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone: 2.5.1
Component: General | Version: 2.5
Severity: minor | Keywords: UTF-8, BOM, testcase
---------------------+------------------------------------------------------
In WordPress unit test,
[http://svn.automattic.com/wordpress-tests/wp-testdata/jacob/utf-8.txt
wordpress-tests/wp-testdata/jacob/utf-8.txt]
has UTF-8 BOM at the beginning of the file so that testcase
[http://svn.automattic.com/wordpress-tests/wp-
testcase/jacob/TestFormatting.php wordpress-tests/wp-
testcase/jacob/TestFormatting.php]
Test_UTF8_URI_Encode::test_percent_encodes_non_reserved_characters()
fails. Because BOM code (0xef, 0xbb, 0xbf. for UTF-8) is tried to be url
encoded.
[http://unicode.org/faq/utf_bom.html#BOM BOM] should not be included in
this kind of test data.
You may take out the first 3 bytes from the test file, or UTF-8 compliant
editor usually has an option letting you choose whether you use BOM or not
for UTF text. I think turn off the option (no BOM) is better in most case.
I confirmed after taking BOM the test case worked fine.
--
Ticket URL: <http://trac.wordpress.org/ticket/6690>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list