eruna — 2011-08-29T21:23:29-04:00 — #1
I am experiencing a problem where data loaded into input fields are being changed from special characters to actual characters which causes problems when submitted.
In other words, instead of: ñ
this character is displayed and submitted: ñ
The end result is question marks in the output.
What is the best way to manage this?
immerse — 2011-08-30T03:28:09-04:00 — #2
You'll need to htmlentity it:
echo '<input type="text" name="myText" value="' . htmlentities('ñ') . '" />';
This will output something like:
<input type="text" name="myText" value="&ntilde;" />
Which will show an input in your HTML page containing: ñ
eruna — 2011-08-31T13:27:05-04:00 — #3