Quickform & Foreign Text

From: Date: Thu, 18 Nov 2004 13:05:33 +0000
Subject: Quickform & Foreign Text
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-15633@lists.php.net to get a copy of this message
I am using HTML_Quickform to process a form that will use primarily English but should be able to deal with Korean characters. The Korean characters are INSERTed into my database as they should be, represented by html entities(ex. & #50516;). The problem arises when a user goes to edit their submission and I have to setDefaults to place what they have written into a <textarea>. Quickform is turning all ampersands into (& amp;) Therefore the Korean text is turned into unreadable html entities which look like this: (& amp#50516;). Is there a way I can make sure that HTML_Quickform does not convert the ampersand that appears on Korean text into & amp;? Here is an example of the code i am experimenting on: // Instantiate the QuickForm class $form = new HTML_QuickForm('example', 'POST'); // textarea attributes $attrs = array("rows"=>"10", "cols"=>"50"); // Translates to 2 korean characters with an apostrophe in the middle $DESC = html_entity_decode ("& #50516; & #48317; & #39; & #46321; & #48152;"); // Set defaults for the form elements $form->setDefaults(array('textareaExample' => $DESC)); // The textarea field $form->addElement('textarea','textareaExample','Text', $attrs); Thanks in advance. I have been struggling with this problem for a few days now. Eric

« previous php.pear.general (#15633) next »