Utf8 Characters In File Name

liunx

Guest
I have a PHP script on my clients site that lists the files in a directory in a HTML Select Form. Sometimes the file names need to have UTF8 characters in them. The filename can be read normally using readdir() (I need to utf8_encode() the name to have it appear as it should in the web page). However, I get a "The requested URL myurl.html was not found on this server" message when trying to load the file, which is the submit action of choosing an item from the HTML Select Form. The error arises regardless whether the file name has utf8_decode() applied to or is in the UTF8 encoding. The Form has accept-charset='utf-8' in the tag.<br /><br />If anyone has experience using PHP with utf8 encoding, help is greatefully accepted.<!--content-->
I figured out the problem - you need to call htmlspecialchars() before putting the filename as a value into the Select.<!--content-->
Thank you for the update <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
whoops - I meant rawurlencode()<!--content-->
 
Top