What's the difference between writing in Ansi and UTF-8
(without BOM) for example for a PHP or an HTML document, and then
uploading them on a web server?
Both documents have the <meta charset="utf-8">
tag in their head.
If someone writes simply with notepad, they have to choose ANSI,
because notepad doesn't offer UTF-8 without byte order mark (BOM).
The difference is that if you write your file in some 8-bit codepage and then forget to convert it to UTF-8, people might see your web page broken, because you set the charset is set to UTF-8 in meta; and to apply that bug fix in hurry, you cannot access the file in place using SFTP or WinSCP, because you'd have to convert into 8-bit codepage first again.
Furthermore UTF-8 is Unicode, and the full range of characters is supported, while in "ANSI" codepages then no. Not all Unicode documents can be converted back to "ANSI" codepages, and thus you could not edit them this way.
No sane person uses Windows Notepad for serious coding because its lack of functionality, syntax coloring, line ending formats and because of its awful support for character sets.