php fwrite不会创建文件名,因为它们是导入的(ÅÄÖ变成ääÃ)

I'm using a form to send a subject and a message. I then remove all spaces from the subject using $subject = str_replace(" ", "_", $subject);

I then create a file using $file = fopen($subject, wb) The filename doesn't support the characters Å Ä and Ö. Instead they become ä ä and ö

When i echo $subject; it comes out normal.

I would prefer not having to replace them since I'm making a website for Swedish speaking people.

Make sure your PHP file is properly encoded. I reckon it should be UTF8 but not sure for Swedish.