1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-30 19:00:10 +02:00

Core.EscapeNonASCIICharacters now always works, even if target is UTF-8.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang
2011-12-25 03:32:25 -05:00
parent 1255d0f15d
commit 9b10515fa4
3 changed files with 13 additions and 3 deletions

View File

@@ -123,7 +123,15 @@ class HTMLPurifier_EncoderTest extends HTMLPurifier_Harness
HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context),
"&#20013;&#25991; (Chinese)"
);
}
function test_convertFromUTF8_withProtectionButUtf8() {
// Preserve the characters!
$this->config->set('Core.EscapeNonASCIICharacters', true);
$this->assertIdentical(
HTMLPurifier_Encoder::convertFromUTF8($this->getZhongWen(), $this->config, $this->context),
"&#20013;&#25991; (Chinese)"
);
}
function test_convertToASCIIDumbLossless() {