Menu

#225 Onlineditor does not work with UTF-8

phpCMS_1.2.1pl2
open
Editor (15)
5
2006-01-04
2005-08-30
Anonymous
No

Unfortunately the integrated online-editor does not
work with UTF-8 encoded contentfiles. It displays the
characters with more than on byte as multiple
characters with the values of each byte. It think this
behavior comes from a string-manipulation in the
sourcecode.

Discussion

  • Martin Jahn

    Martin Jahn - 2006-01-04

    Logged In: YES
    user_id=607933

    I have had the same problem and fixed this for me.
    In class.parser_template_phpcms.php in the function DoField I removed the call of
    htmlentities:

    /* prepared to use a wysiwyg online editor */
    if($EditType == 'WYSIWYG' && file_exists($PHPCMS_INCLUDEPATH.'/class.
    edit_wysiwyg_phpcms.php')) {
    $buffer = stripslashes(implode('', $PAGE->content->$FIELD));
    ob_start();
    include($PHPCMS_INCLUDEPATH.'/class.edit_wysiwyg_phpcms.php');
    $wysiwyg_buffer = ob_get_contents();
    ob_end_clean();
    $PartTwo = implode('', $this->ReturnEmty('', $PartTwo));
    $ReturnBuffer[0] = $PartOne.$wysiwyg_buffer.$PartTwo;
    unset($wysiwyg_buffer);
    } else {
    $PartTwo = implode('', $this->ReturnEmty('', $PartTwo));
    //$buffer = htmlentities(implode('', $PAGE->content->$FIELD));
    // BOF (mjahn) added UTF-8 capapbility to the online-editor
    // unfortunately I have to remove the htmlentities-filter-ability
    $buffer = htmlentities(implode('', $PAGE->content->$FIELD));
    // EOF (mjahn)
    $ReturnBuffer[0] = $PartOne.$buffer.$PartTwo;
    }

     
  • Martin Jahn

    Martin Jahn - 2006-01-04
    • assigned_to: nobody --> mjahn
     
  • Nobody/Anonymous

    Logged In: NO

    If you only use English as language for the admin-ui you can
    patch the class.layout_phpcms.php as well.

    The patch-file as text:
    79c79
    < '<meta http-equiv="content-type"
    content="text/html;charset=iso-8859-1" />'."\n".
    ---
    > '<meta http-equiv="content-type"
    content="text/html;charset=' . $DEFAULTS->CHARSET . '"/>'."\n".

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.