NOTE:: Before reporting an issue, make sure you are running the latest version, currently 3.3.1

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015324phplist applicationInterface - Frontendpublic26-08-09 13:2729-04-11 12:42
PlatformOSOS Version
Product Version2.10.10 
Target VersionFixed in Version4.0.x 
Summary0015324: Subject and From turn to Gibberish when saved not in English
DescriptionThis is how the subject of this bug report should be phrased. Please direct all the specific bug reports (e.g. "subject doesn't work in my language" that won't consider other people) in here.

The problem is in public_html/lists/admin/send_core.php:

    iconv('ISO-8859-1','UTF-8',$subject) and htmlentities(iconv('ISO-8859-1','UTF-8',$from) - those statements assume one uses ISO-8859-1, which is why you only get bug reports from people using other languages...

Note those statements were only added in recent versions. For example, v2.10.7 didn't have them and thus had no problems.

Here's the fix:

// custom code - start
  $utf8_subject = $subject;
  $utf8_from = $from;
  if (strcasecmp($GLOBALS['strCharSet'], 'utf-8') <> 0) {
     $utf8_subject = iconv($GLOBALS['strCharSet'],'UTF-8',$utf8_subject);
     $utf8_from = iconv($GLOBALS['strCharSet'],'UTF-8',$utf8_from);

  $maincontent .= '
  <tr><td>'.Help("subject").' '.$GLOBALS['I18N']->get("Subject").':</td>
    <td><input type=text name="msgsubject"
    //value="'.htmlentities($utf8_subject,ENT_QUOTES,'UTF-8').'" size=40></td></tr>
    <td colspan=2>
  <tr><td>'.Help("from").' '.$GLOBALS['I18N']->get("fromline").':</td>
    <td><input type=text name=from
    value="'.htmlentities($utf8_from,ENT_QUOTES,'UTF-8').'" size=40></td></tr>
  <tr><td colspan=2>

// custom code - end
Additional InformationThe "//" in "//value" shows up in the HTML code. See bug report 0015323
TagsNo tags attached.
Attached Files

- Relationships
related to 0001644resolvedmichiel Subject error with UTF-8 encode in Traditional Chinese 
related to 0015241resolveduser4391 Subject will empty when we edit the message 
related to 0015463resolvedmichiel Call to iconv() doesn't fail gracefully and prevents FCKeditor from loading 

-  Notes
h2b2 (manager)
28-08-09 05:28

Issue with use of iconv() confirmed in [^]

It seems to me the iconv() function was introduced when trying to fix issue [^]

Charset hardcoding should be avoided, IMO. Configurable charset encoding would make the system much more flexible and help avoid all sorts encoding incompatibilities.
See also [^]
h2b2 (manager)
29-08-09 14:34

See also [^]
michiel (manager)
29-04-11 12:42

the character encoding issues have been dealt with in the 2.11 versions

Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker