Suppose I have an input field in a web page with charset UTF8; suppose I open a text file encoded with ISO-8859-1 as charset.
Now I copy and paste a string with special characters (like, for example, ô) from file to the input field : I see that the special characters is correctly displayed into input field.
Who does the conversion from ISO-8859-1 to UTF8? The browser?
When you open the file and copy/paste it to the browser, it ends up in Unicode, as that is what the browser’s UI controls use internally. Who actually performs the conversion from ISO-8859-1 to Unicode depends on a few factors (what OS you are using, whether your chosen text editor is compiled to use Ansi or Unicode, what clipboard format(s) –
CF_TEXTfor Ansi,CF_UNICODETEXTfor Unicode – the app uses for the copy, etc). But either way, when the web browser submits the form, it then encodes its Unicode data to the charset of the HTML/form during transmission.