Avoiding double encoding in <INPUT> while using htmlspecialchars
问题 Say you have a text <INPUT> for a user's name and they decide to type in Johnny's Pizza This is saved in DB as Johnny's Pizza But if the user decides to edit, I repopulate the text <INPUT> as follows echo form_input('name', htmlspecialchars($name, ENT_QUOTES, 'UTF-8')); which will show as Johnny's Pizza inside the input field. PHP.net has a comment here suggesting to use echo form_input('name', htmlspecialchars($name, ENT_QUOTES, 'UTF-8', FALSE)); that is, FALSE referring to $double_encoding