From:  mg2aire-pear@yahoo.com ("hanousman")
Date:  08 Sep 2017 22:26:14 Hong Kong Time
Newsgroup:  news.php.net/php.pear.bugs
Subject:  

[PEAR-BUG] Bug #20489 [Com]: Textareas with umlauts or other special chars are rendered empty

NNTP-Posting-Host:  null

Edit report at http://pear.php.net/bugs/bug.php?id=20489&edit=1

 ID:               20489
 Comment by:       hanousman
 Reported By:      mg2aire-pear at yahoo dot com
 Summary:          Textareas with umlauts or other special chars are
                   rendered empty
 Status:           Open
 Type:             Bug
 Package:          HTML_QuickForm
 Operating System: Kubuntu 14.04.1
 Package Version:  3.2.14
 PHP Version:      >=5.4
 New Comment:

The culprit is htmlspecialchars in element.php, textarea.php and so on.

It doesn't work if the text encoding parameter is not set correctly.

You can try to use htmlspecialchars ( $string , ENT_COMPAT | ENT_HTML401
| ENT_SUBSTITUTE )

ENT_SUBSTITUTE : Replace invalid code unit sequences with a Unicode
Replacement Character U+FFFD (UTF-8) or ? (otherwise) instead of
returning an empty string.


Previous Comments:
------------------------------------------------------------------------

[2015-01-19 21:53:38] fhbo_fbw

-PHP Version: Irrelevant +PHP Version: >=5.4
------------------------------------------------------------------------ [2015-01-19 17:41:33] fhbo_fbw Description: ------------ When creating text areas, default values containing umlauts or other special chars force them to be rendered completely empty. Test script: --------------- addElement('text', 't1', 'Text'); $form->addElement('textarea','ta','Text area'); $form->addElement('submit','sb','Submit form'); $form->setDefaults(array("t1"=>"瓣繹羹�", "ta"=>"瓣繹羹�")); $form->display(); ?> Expected result: ---------------- text inputs and text area inputs showing 瓣繹羹� as initial value Actual result: -------------- only text inputs showing 瓣繹羹� as initial value ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=20489&edit=1