View Issue Details

IDProjectCategoryView StatusLast Update
0015324phplist applicationInterface - Frontendpublic29-04-11 11:42
Reporterlwc 
PrioritynormalSeveritymajorReproducibilitysometimes
Status resolvedResolutionfixed 
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>
  <tr>
    <td colspan=2>
    </td></tr>
  <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>

  </td></tr>';
// custom code - end
Additional InformationThe "//" in "//value" shows up in the HTML code. See bug report 0015323
TagsNo tags attached.

Relationships

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

Activities

h2b2

28-08-09 04:28

manager   ~0050719

Issue with use of iconv() confirmed in http://forums.phplist.com/viewtopic.php?f=17&t=28038

It seems to me the iconv() function was introduced when trying to fix issue http://mantis.phplist.com/view.php?id=15241

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 http://mantis.phplist.com/view.php?id=1644

h2b2

29-08-09 13:34

manager   ~0050725

See also http://mantis.phplist.com/view.php?id=15287

michiel

29-04-11 11:42

manager   ~0051195

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