Feature Requests item #2828299, was opened at 2009-07-28 12:56
Message generated for change (Comment added) made by itetcu
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1126468&aid=2828299&group_id=250683
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
>Category: webui
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Xueron Nee (srni)
Assigned to: Nobody/Anonymous (nobody)
>Summary: UTF-8 encoding for WebUI
Initial Comment:
A message with subject:
=?ISO-2022-JP?B?WxskQjJENT8bKEJceHs5MGFlfRskQjdvGyhCXSA=?=
=?ISO-2022-JP?B?SlNIT1BQRVJTGyRCRXFKdUU5ISRLXDx+GyhC?=
=?ISO-2022-JP?B?GyRCRy5HYz4mSUpFOUQ5P2RBJiEqGyhC?
=
in system.log, the subject was decoded to: [ $B2D5? (B\x{90ae} $B7o (B]
JSHOPPERS $BEqJuE9!$K\<~ (B $BG.Gc>&IJE9D9?dA&!* (B
It seems ISO-2022-JP was not recognized and treaded as ISO-8859-1.
:) thanks
----------------------------------------------------------------------
>Comment By: Ion-Mihai "IOnut" Tetcu (itetcu)
Date: 2009-08-02 10:12
Message:
No, it won't make it to 3.9.0, maybe 3.9.1
----------------------------------------------------------------------
Comment By: Stevan Bajic (sbajic)
Date: 2009-07-29 14:13
Message:
And here the PHP code showing how that subject would be needed to be
converted to display properly in the Web UI:
-----
<?php
echo "<html><head><title>test</title></head><body>\n";
$text = array("WxskQjJENT8bKEJceHs5MGFlfRskQjdvGyhCXSA=",
"SlNIT1BQRVJTGyRCRXFKdUU5ISRLXDx+GyhC",
"GyRCRy5HYz4mSUpFOUQ5P2RBJiEqGyhC");
for ($x=0;$x<count($text);$x++) {
echo mb_convert_encoding(base64_decode($text[$x]), "HTML-ENTITIES",
"ISO-2022-JP") . "<br>\n";
}
echo "</body>\n";
?>
-----
Result:
-----
<html><head><title>test</title></head><body>
[可疑\x{90ae}件] <br>
JSHOPPERS淘宝店,本周<br>
熱買商品店長推薦!<br>
</body>
-----
Kind Regards from Switzerland
Stevan Bajic
----------------------------------------------------------------------
Comment By: Stevan Bajic (sbajic)
Date: 2009-07-29 13:58
Message:
Hallo Xueron Nee
The decoding is right. The whole line is encoded in Base64 and the
decoding was done right but the code page ISO-2022-JP is not used in the
Web UI.
Try yourself to decode the subjects by using this link here:
http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx
When decoding just remove the starting "=?ISO-2022-JP?B?" part and the
"?=" at the end of the subject.
To illustrate how the decoding part works you could quickly put the
following lines into a file and call it with the PHP interpreter:
-----
<?php
$text =
array("=?ISO-2022-JP?B?WxskQjJENT8bKEJceHs5MGFlfRskQjdvGyhCXSA=?=",
"=?ISO-2022-JP?B?SlNIT1BQRVJTGyRCRXFKdUU5ISRLXDx+GyhC?=",
"=?ISO-2022-JP?B?GyRCRy5HYz4mSUpFOUQ5P2RBJiEqGyhC?=");
for ($x=0;$x<count($text);$x++) {
$elements = imap_mime_header_decode($text[$x]);
for ($i=0; $i<count($elements); $i++) {
echo "Charset: {$elements[$i]->charset}\n";
echo "Text: {$elements[$i]->text}\n\n";
}
}
?>
-----
The output should be:
-----
Charset: ISO-2022-JP
Text: [2D5?\x{90ae}7o]
Charset: ISO-2022-JP
Text: JSHOPPERSEqJuE9!$K\<~
Charset: ISO-2022-JP
Text: G.Gc>&IJE9D9?dA&!*
-----
PHP does exactly the same decoding as DSPAM. Is that decoding wrong? I
can't believe PHP to decode it wrongly. Do display that subject line
correctly in the Web UI we would need to decode it and then encode it in
HTML encoded UTF-8 codes. And I don't think that this will happen for
v3.9.0 release. Maybe the new Web UI will handle that. But I don't know.
I am going to change that bug to be a feature request for the new Web UI.
Kind Regards from Switzerland
Stevan Bajic
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1126468&aid=2828299&group_id=250683
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Dspam-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-devel