Please forgive me, I am new here. I hope I have formatted this correctly. I have converted a database from ASCII to UTF-8 changing all of the Special Characters. Example â changed to â
Working Example: Domaine Comte Georges de Vogüé
changed to,
Domaine Comte Georges de Vogüé
In my HTML page I have a form with the line below as one of the options.
<option>Domaine Comte Georges de Vogüé</option>
When the form is posted to the PHP page the value is changed to
Domaine Comte Georges de Vogüé
So when it is searched for in the database of course it is not found.
The options for the dropdown field are generated dynamically using code I found at [So You Need To Fill a Dropdown Dynamically https://css-tricks.com/dynamic-dropdowns/]
How do I keep the option value from changing when posted to the PHP script?
Did you try setting a value to the option?
<option value="Domaine Comte Georges de Vogüé">Domaine Comte Georges de Vogüé</option>
You need to convert the HTML entities as displayed on the page (ü, é, etc.) to their representative values prior to performing the database search; this can be accomplished using the PHP function html_entity_decode() -- for example:
<?php
print html_entity_decode('Domaine Comte Georges de Vogüé');
?>
Will result in an output of --
Domaine Comte Georges de Vogüé
More information, options, and examples of usage can be found within the PHP manual -- http://php.net/manual/en/function.html-entity-decode.php