How-to articles, tricks, and solutions about UTF-8
error UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Here is an example of how to handle a UnicodeDecodeError caused by an invalid start byte:
file_get_contents() Breaks Up UTF-8 Characters
The file_get_contents() function in PHP is used to read the contents of a file into a string.
Getting ’ instead of an apostrophe(') in PHP
This can occur if your PHP code is using the ISO-8859-1 character set instead of UTF-8.
How can I write a file in UTF-8 format?
To write a file in UTF-8 encoding with PHP, you can use the fopen, fwrite, and fclose functions.