I was also thinking about charsets, BOM (byte order marks) and other shenanigans that had to be correct in the top of the file for things to display as expected. At least it was a struggle for 13 year old me why sometimes æøå showed up completely broken, and sometimes not. Today it feels like a solved issue, all files are UTF-8 all the way and it just works.
https://www.w3.org/International/questions/qa-byte-order-mar...
It is still important to declare UTF-8 either in <meta> or Content-Type header, otherwise it will usually default to Windows-1252. Yay compatibility!