On Wed, 31 Aug 2011 07:39:43 +0100, Stas Malyshev <smalys...@sugarcrm.com> wrote:

Hi!

On 8/30/11 11:32 PM, Gustavo André dos Santos Lopes wrote:
cataphract                               Wed, 31 Aug 2011 06:32:05 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=315851

Log:
- Fixed test htmlentities15.phpt.

Changed paths:
U php/php-src/branches/PHP_5_4/ext/standard/tests/strings/htmlentities15.phpt U php/php-src/trunk/ext/standard/tests/strings/htmlentities15.phpt

Modified: php/php-src/branches/PHP_5_4/ext/standard/tests/strings/htmlentities15.phpt
===================================================================
--- php/php-src/branches/PHP_5_4/ext/standard/tests/strings/htmlentities15.phpt 2011-08-31 06:26:39 UTC (rev 315850) +++ php/php-src/branches/PHP_5_4/ext/standard/tests/strings/htmlentities15.phpt 2011-08-31 06:32:05 UTC (rev 315851)
@@ -11,6 +11,9 @@
        die("skip setlocale() failed\n");
  }
  ?>
+--COMMENT--
+As of PHP 5.4, htmlentities() no longer makes replacements with numerical
+entities. Hence, for this input there's no substitution.
  --FILE--
  <?php
  setlocale(LC_CTYPE, "ru_RU.koi8r", "ru_RU.KOI8-R");
@@ -19,4 +22,4 @@
  ?>
  --EXPECT--
  string(9) "���������"
-string(63) "&#1088;&#1086;&#1089;&#1082;&#1086;&#1096;&#1085;&#1099;&#1081;"
+string(9) "���������"

Could you explain what this test is doing and why? What '' encoding means (docs say nothing of it), why we set locale to KOI8-R?

The '' encoding activates the old behavior of detecting the encoding. This detection from the locale and other sources dates to before htmlentitites had an encoding parameter.

It's been working this way since 2001: http://lxr.php.net/xref/PHP_TRUNK/ext/standard/html.c?a=true&r=50559#229 In the revision before, not specifying the encoding would have the same effect as specifying '', i.e. autodetection.

But you're right, it should be documented.

(CC to internals because you also sent an e-mail about this test there)

--
Gustavo Lopes

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to