-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mb_decode_mimeheader obeys RFC 2047 regarding underscores and QPrint …
…encoding
- Loading branch information
Showing
4 changed files
with
37 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--TEST-- | ||
Test mb_decode_mimeheader() function: use of underscores in QPrint-encoded data | ||
--EXTENSIONS-- | ||
mbstring | ||
--FILE-- | ||
<?php | ||
|
||
// RFC 2047 says that in a QPrint-encoded MIME encoded word, underscores should be converted to spaces | ||
var_dump(mb_decode_mimeheader("=?UTF-8?Q?abc?=")); | ||
var_dump(mb_decode_mimeheader("=?UTF-8?Q?abc_def?=")); | ||
var_dump(mb_decode_mimeheader("_=?UTF-8?Q?abc_def?=_")); | ||
var_dump(mb_decode_mimeheader("=?UTF-8?Q?__=E6=B1=89=E5=AD=97__?=")); | ||
|
||
// This is how underscores should be encoded in MIME encoded words with QPrint | ||
var_dump(mb_decode_mimeheader("=?UTF-8?Q?=5F?=")); | ||
|
||
?> | ||
--EXPECT-- | ||
string(3) "abc" | ||
string(7) "abc def" | ||
string(9) "_abc def_" | ||
string(10) " 汉字 " | ||
string(1) "_" |