lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I avoid unicode and use Latin1? (Was: Wrong characterswith j


From: stk
Subject: Re: How can I avoid unicode and use Latin1? (Was: Wrong characterswith jEdit)
Date: Fri, 2 Sep 2005 17:18:53 -0400 (EDT)

On Fri, 2 Sep 2005, Hans de Rijck wrote:

> Or, for someone with a C compiler, the poor-man's algorithm is:
>
>     for ( unsigned int i = 0; i < length; i++ )
>     {
>         if ( (unsigned char)line1[i] > 127 )
>         {
>             *line2++ = (char)(192 + (((unsigned char)line1[ i ]) / 64));
>             *line2++ = (char)(128 + (((unsigned char)line1[ i ]) % 64));
>         }
>         else
>         {
>             *line2++ = line[ i ];
>         }
>     }

I can't afford a C compiler for Windows, and I can't switch to Linux or to
a Mac for work reasons.  But I know C, and the code (above) is very clear.
Thank you for the very specific information.  I have to admit that I
didn't know what unicode coding looked like.  I suppose I should break
down and download the unicode specs from somewhere.

But I still think LilyPond should allow the option of putting a command
at the top of a *.LY file marking it as either Latin-1 or unicode.  All
the code for allowing Latin-1 exists; it was used in LP 2.4 according to
Mats.  There are plenty of computer users in North America who take it for
granted that all Windows software can understand Latin-1.

> But in general, the quickest solution is to load the file in Notepad, and
> save as UTF-8.

I have the world's oldest Notepad, and it won't save as "unicode text",
which frankly I view as an advantage, as I want to have at least one text
editor that can be absolutely counted to save in Latin-1 no matter what.
But I could open the text file with WordPad, if I wanted, as WordPad will
allow saving as unicode text.

And now that I think about it, I could fake the unicode myself in a
Latin-1 text editor using the information inherent in your conversion
routine.  (I only need Latin-1 [or unicode] rarely, in some song titles.)

The situation is clearer now.  Thank you for your help.

-- Tom





reply via email to

[Prev in Thread] Current Thread [Next in Thread]