Re: Unicode encoding issue for LilyPond engraving files
David Wright <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Message-ID | <aiuCvtCAaqe7F2E/@axis.corp> |
On Thu 11 Jun 2026 at 12:47:00 (-0400), Gabriel Ellsworth wrote: > On Tue, 9 Jun 2026, Massimo Capozza wrote: > > > As I mentioned in a previous email, we already have these MIME > > declarations in .htaccess: > > AddType application/x-nwc nwc > > AddType application/x-sibelius-score sib sco > > AddType application/octet-stream cap capx* > > Normally, these declarations should directly open the file in the > > application associated to the relevant file extension, which the user can > > freely select on his/her computer. So, in the case of Lilypond, one may > > select Frescobaldi, a text editor (e.g., Notepad++ that will immediately > > detect the UTF-8 encoding), or whatever else. If no application is > > associated, the file is downloaded "as is". This behaviour is in use since > > many years, and nobody complained about it, so I think that it would be > > fine for Lilypond, too, without introducing inconsistencies with other > > music file formats. > > > > These are the reasons why I proposed to use "application/x-lilypond". Why? There are many text/whatever MIME types that can be treated in just the same way. For example, you'd typically open text/html in a browser. But the point is that text/html can be read by humans, so text/ is correct. You'd use application/…html… where the underlying html had been mangled in some manner (eg encrypted). > > "text/x-lilypond" would also work, but just because the Lilypond files are > > text files, it would not work for the other music file types. Of course it wouldn't: they're not text. And that's why, in the quote above, you have written application/x-sibelius-score sib sco . > If I could click (left-click) .ly files on CPDL and have them open > immediately in Frescobaldi, that would also be convenient. > > *To summarize, it seems that there are two options for CPDL:* > > > 1. Use text/x-lilypond for a UX like that of Álvarez’s website. > 2. Use application/x-lilypond for consistency within CPDL across > music-engraving file formats (LilyPond, Sibelius, NWC, etc.). Again, consistency is not a valid argument here. Quite simply, LilyPond files are text, readable by humans, and the others aren't. > Personally, I prefer option (1) because it is even more convenient for me > than (2); I like being able to view .ly files within my browser. > > But either of these options would definitely be a significant improvement > upon CPDL’s current state for me as a LilyPond user! One disadvantage of using application/whatever is that clients are quite likely not to display it by default, ie without the user taking some action, even where that is trivial (like tapping the keystrokes for ShowAttachments,Select,Display). Having done that, what is displayed has been treated as binary data, which means that line-endings can be interpreted inappropriately (eg unix users may see ^M written at the end of every line). Cheers, David.