Re: Encoding Issue for .ly Files on CPDL
Silvain Dupertuis <[email protected]>
| Newsgroups | gmane.comp.gnu.lilypond.general |
|---|---|
| Message-ID | <[email protected]> |
I am not sure if what you mention works for our problem.. I will repeat a few things I mentioned to only some of you. As far as I understand: The HTTP header controls the encoding of the web page (html), /not/ the displaying of external files like .ly files. Then if something was possible on the web page, that should be in the link to the ly file. I did not find anything at this level. But maybe it would be possible. For me, *adding 2 lines of code at one single place for a whole website* like specified on this test page : https://silvain-dupertuis.org/test/lilypond/displaying-text-files.html, remains the easiest solution. The problem is not only CPDC. It is actually the same on the other websites displaying .ly files, because with the default settings of the web servers (apache), they are not recognized as standard text files. They would neverthelessuzr 0983z907 irxcgvà1 C be displayed correctly if renamed with a .txt or a ly.txt exension. Moreover, these Lilypond files are *correct when downloaded*. It is only the interpretation of extended characters which is wrong on the screen. Silvain Le 03.06.26 à 14:35, Hans Åberg a écrit : >> On 3 Jun 2026, at 14:02, Gabriel Ellsworth<[email protected]> wrote: >> >> Thanks very much for your help, Silvain, Hans, and Hans. >> >> IIUC, what CPDL should do is to edit/adjust the HTTP response headers that CPDL’s server sends/returns to browsers. >> >> Those HTTP response headers should include: >> Content-Type: text/xml; charset=utf-8 >> >> Is all of the above correct? > I made a net search for “how to make http header indicate UTF-8”, and got results like: > https://community.smartbear.com/discussions/soapui_os/how-to-set-encoding-utf-8-in-request-post-/8818 > https://stackoverflow.com/questions/4279282/how-to-set-http-header-to-utf-8-using-php-which-is-valid-in-w3c-validator > >> And just to confirm, should it be text/xml and not text/plain? > This link says you should have text/plain at least for MIME, and that application/xml supersedes text/xml. > https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types/Common_types > > There is also: > https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Type > >> On Tue, 2 Jun 2026, Hans Åberg wrote: >> Actually, I made a typo above: the suggestion says one in the Headers tab should add a new header named “Content-Type” (without the quotes) and set the value to “text/xml; charset=utf-8”. :-) -- Silvain Dupertuis Route de Lausanne 335 1293 Bellevue (Switzerland) tél. +41-(0)22-774.20.67 portable +41-(0)79-604.87.52 web: silvain-dupertuis.org <https://perso.silvain-dupertuis.org>