Everything is working dandy except for when I upload a file and give it it's own name (via a text field in a html form) "Åäöô - KARL".
I have made a custom fileupload/handler/cms for my site and everything works except for when the file is uploaded.
When I look directly at the file upload directory via my ftp-program the file name is all of a sudden "Åäöô - KARL".
- I run html5 with
<meta charset="UTF-8" />
at the start of every page - I encode while writing code with UTF-8 Without BOM
I've tried iconv()
, is there something I'm missing? I'm suspecting it's between the html form $_POST['name_of_file']
and when I run the command
move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_POST['name_of_file'])
Progress: I actually did a "utf8_decode" and now the file is saved as the correct name, it's displaying weird on my site though now, so I have to encode it when I want to display it.
Anyway to get around having to type utf8_encode and utf8_decode everywhere??
For others this post might help: How to handle user input of invalid UTF-8 characters?