0

I'm making a website with PHP, MYSQL and AJAX (besides HTML and CSS).
I have a form in which the user input a name of a song and its lyrics will be stored in a file, called as the song title.
I've just tested this form and it works. But when I want to input a title which have accented letters, PHP replaces accented letters with something like ò... In fact I've tried to input this string "All'alba sorgerò" and the file created is called "All'alba sorgerò.txt"
How can I fix it?

Thanks in advance (and sorry for my bad English ^^'')

  • This might help in cleaning the characters to become normal alphabetical http://stackoverflow.com/questions/3371697/replacing-accented-characters-php#3373364. –  Apr 25 '16 at 18:37
  • 1
    possible duplicate of [UTF-8 all the way through](http://stackoverflow.com/questions/279170/utf-8-all-the-way-through) – Funk Forty Niner Apr 25 '16 at 18:39
  • Are you sure you want to do it that way? It may generate a lot of configuration troubles because depending of the operative system and even the file system some characters may not be valid. You change from windows to linux and you get a lot of trouble to deal with, my advice it to avoid that and put the name of the song inside the file, not in the name of the file itself. – bns Apr 25 '16 at 18:42
  • you need to ensure that the text in php is using the same charset as your underlying OS's filesystem. – Marc B Apr 25 '16 at 18:44

0 Answers0