I need to write out a file to disk with special ISO-8859-15 characters. For my own testing purposes, I used:
—©®±àáâãäåæÒÓÔÕÖ¼½¾§µçðþú–.jpg
...but the em-dash, en-dash, and the 1/2, 1/4, and 3/4 fractions were replaced with garbage when the file was written to disk with this name, while the other characters in the file name were written out correctly. Why some and not others???
Here is a very simple PHP script to write out a file with just copyright symbols and em-dashes in its name. When I run it, the string is written to the file correctly, but the filename's em-dashes are replaced with garbage:
<?php
// First, create a text file with the em-dash and the copyright symbol, then put the file prefix into the file:
$filename1 = "000—©—©.txt";
$content1 = "000—©—©";
file_put_contents($filename1, $content1);
?>
What is the most efficient and elegant way to do this using PHP (or Javascript)? I'm targeting the ISO-8859-15 character set ONLY.
Many thanks! Tom