0

I have an .mp3 file and the title of the file has special characters Óró Sé do Bheatha Bhaile.mp3 When this file is opened in Safari instead of displaying the óit will display o?

I have tried changing the encoding on the MP3 file using the mutagen library that converts ID3 tags from legacy encodings to Unicode and stores them using the ID3v2 format. find . -name "*.mp3" -print0 | xargs -0 mid3iconv -e windows-1255 -d

I have tried Mp3 Tag Editor Online in the hopes that it might set utf-8 encoding on the mp3 file but no luck

When I send the file to Chrome or Firefox the correct character encoding is used.

I've also added the utf-8 encoding to when I'm downloading the file as described in downloading files with special characters in Safari:

disposition: "attachment; filename*=UTF-8''filename"

The desired behaviour is that when a user downloads one of these files from the website that the correct file name with the correct character encodings are displayed on the website. Anyone any ideas how to fix this on Safari?

AmigoJack
  • 5,234
  • 1
  • 15
  • 31
Linda Keating
  • 2,215
  • 7
  • 31
  • 63
  • See [How to encode the filename parameter of Content-Disposition header in HTTP?](https://stackoverflow.com/a/6745788/4299358). Also the HTTP header must be `Content-Disposition:` and your `filename` must be percent-encoded. Filenames have nothing to do with the file's content (such as ID3 metadata). – AmigoJack Jul 18 '22 at 18:39
  • Thanks @AmigoJack. I think `disposition: foo bar` is a rails erb way of writing `Content-Disposition` but I will recheck the docs. https://apidock.com/rails/ActionController/DataStreaming/send_file – Linda Keating Jul 18 '22 at 23:05

0 Answers0