thomascube
2005-11-18 4b0f65a597c8339b513bc44e16a95f3803c26369
program/include/rcube_shared.inc
@@ -1188,7 +1188,7 @@
// replace specials characters to a specific encoding type
function rep_specialchars_output($str, $enctype='', $mode='', $newlines=TRUE)
  {
  global $OUTPUT_TYPE;
  global $OUTPUT_TYPE, $CHARSET;
  static $html_encode_arr, $js_rep_table, $rtf_rep_table, $xml_rep_table;
  if (!$enctype)
@@ -1208,8 +1208,14 @@
    {
    if (!$html_encode_arr)
      {
      $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS); // HTML_ENTITIES
      $html_encode_arr[chr(128)] = '€';
      if ($CHARSET=='ISO-8859-1')
        {
        $html_encode_arr = get_html_translation_table(HTML_ENTITIES);
        $html_encode_arr[chr(128)] = '€';
        }
      else
        $html_encode_arr = get_html_translation_table(HTML_SPECIALCHARS);
      unset($html_encode_arr['?']);
      unset($html_encode_arr['&']);
      }
@@ -1245,9 +1251,11 @@
    for ($c=160; $c<256; $c++)  // can be increased to support more charsets
      {
      $hex = dechex($c);
      //$js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
      $rtf_rep_table[Chr($c)] = "\\'$hex";
      $xml_rep_table[Chr($c)] = "&#$c;";
      if ($CHARSET=='ISO-8859-1')
        $js_rep_table[Chr($c)] = sprintf("\u%s%s", str_repeat('0', 4-strlen($hex)), $hex);
      }
    $js_rep_table['"'] = sprintf("\u%s%s", str_repeat('0', 4-strlen(dechex(34))), dechex(34));