I try to use file_put_contents (and file_get_contents ) with UTF-8 ¥ after this stackoverflow post: How to write a file in UTF- 8 format? which uses:
$data = mb_convert_encoding($data, 'UTF-8', 'OLD-ENCODING');
This has not been well explained since it causes an error:
mb_convert_encoding(): Illegal character encoding specified
So, 'OLD-ENCODING' was just the placeholder they used. The question I have is what encoding should I change? ASCII or ISO-8859-1? What encoding do most web hosts use? Does it matter?
When I open the file, I will receive the character correctly only if I have my own notebook with UTF-8 encoding. If I open it with a different character set, it will appear with a “ ? ”.
user1631995
source share