mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Add more tests for UTF7-IMAP text conversion
This commit is contained in:
parent
16a1e0a219
commit
df32267494
@ -193,8 +193,17 @@ testValid("&" . mBase64(utf16BE("西红柿") . $longChar1) . "-", "西红柿" .
|
||||
/* Multiple sections of valid ASCII _and_ Base64-encoded text */
|
||||
testValid("123&" . mBase64(utf16BE("123")) . "-abc&" . mBase64(utf16BE("☺")) . "-.", "123123abc☺.");
|
||||
|
||||
/* If a & character appears right after a non-ASCII character, we must first close the Base64
|
||||
* section and then emit &- */
|
||||
testValidString("☺&", "&Jjo-&-", "UTF-8", "UTF7-IMAP", false);
|
||||
testValidString("西瓜&", "&iX903A-&-", "UTF-8", "UTF7-IMAP", false);
|
||||
testValidString("西红柿&", "&iX9+omf,-&-", "UTF-8", "UTF7-IMAP", false);
|
||||
|
||||
echo "Identification and conversion of valid text is working... perfect!\n";
|
||||
|
||||
// Try illegal Unicode codepoint (> 0x10FFFF)
|
||||
convertInvalidString("\x00\x20\x00\x00", "%", "UCS-4BE", "UTF7-IMAP");
|
||||
|
||||
// Test "long" illegal character markers
|
||||
mb_substitute_character("long");
|
||||
convertInvalidString("\x10", "%", "UTF7-IMAP", "UTF-8");
|
||||
|
Loading…
Reference in New Issue
Block a user