[Mutopia-discuss] file encoding should be UTF-8, right?

2014-02-22 Thread Federico Bruni

$ file -i ftp/ScriabinA/O59/prelude/prelude.ly
ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii

Can I run iconv on it, right?
This again will break the diff (see previous thread), but it's needed. 
One more thing to add to the wiki? If you give me the ok, I can edit 
the page myself.
___
Mutopia-discuss mailing list
Mutopia-discuss@mutopiaproject.org
http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss

Re: [Mutopia-discuss] file encoding should be UTF-8, right?

2014-02-22 Thread Federico Bruni
Il sab, feb 22, 2014 at 6:38 , Federico Bruni f...@inventati.org ha 
scritto:

$ file -i ftp/ScriabinA/O59/prelude/prelude.ly
ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii

Can I run iconv on it, right?
This again will break the diff (see previous thread), but it's 
needed. One more thing to add to the wiki? If you give me the ok, I 
can edit the page myself.


I can convert with Gedit. However, what's wrong with the following 
commands?


$ iconv -f US-ASCII -t UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly  
ftp/ScriabinA/O59/prelude/prelude.ly 
$ file -i 
ftp/ScriabinA/O59/prelude/prelude.lyftp/ScriabinA/O59/prelude/prelude.ly: 
inode/x-empty; charset=binary



I've tried also recode, but it doesn't work:

$ recode -v UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly
Request: UTF-8..:libiconv:..CHAR
Shrunk to: UTF-8..CHAR
Recoding ftp/ScriabinA/O59/prelude/prelude.ly... done
$ file -bi ftp/ScriabinA/O59/prelude/prelude.ly
text/plain; charset=us-ascii


___
Mutopia-discuss mailing list
Mutopia-discuss@mutopiaproject.org
http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss

Re: [Mutopia-discuss] file encoding should be UTF-8, right?

2014-02-22 Thread David Kastrup
Federico Bruni f...@inventati.org writes:

 Il sab, feb 22, 2014 at 6:38 , Federico Bruni
 f...@inventati.org ha scritto:
 $ file -i ftp/ScriabinA/O59/prelude/prelude.ly
 ftp/ScriabinA/O59/prelude/prelude.ly: text/plain; charset=us-ascii

 Can I run iconv on it, right?
 This again will break the diff (see previous thread), but it's
 needed. One more thing to add to the wiki? If you give me the ok, I
 can edit the page myself.

 I can convert with Gedit. However, what's wrong with the following
 commands?

 $ iconv -f US-ASCII -t UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly 
 ftp/ScriabinA/O59/prelude/prelude.ly

Same output and input file.  The output redirection operator truncates
the output file to be empty before iconv is run, so it just converts an
empty file.

 I've tried also recode, but it doesn't work:

 $ recode -v UTF-8 ftp/ScriabinA/O59/prelude/prelude.ly
 Request: UTF-8..:libiconv:..CHAR
 Shrunk to: UTF-8..CHAR
 Recoding ftp/ScriabinA/O59/prelude/prelude.ly... done
 $ file -bi ftp/ScriabinA/O59/prelude/prelude.ly
 text/plain; charset=us-ascii

US-ASCII is a subset of UTF-8, so there is nothing to convert here.

What you want is

recode tex..utf-8

here.  The problem is that there are things like avec d\\'efi here
which get turned into avec d\éfi because of the doubled backslash.  At
any rate, you should probably look at _all_ \\ sequences first.  There
is a lot of TeX stuff in there that will stop working, not just accents.

-- 
David Kastrup


___
Mutopia-discuss mailing list
Mutopia-discuss@mutopiaproject.org
http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss


Re: [Mutopia-discuss] file encoding should be UTF-8, right?

2014-02-22 Thread Federico Bruni

Il sab, feb 22, 2014 at 7:12 , Noeck noeck.marb...@gmx.de ha scritto:

Hi,

I might be wrong, but the file has no property like utf8 orascii, 
it

is just encoded as such. Ascii is a subset of utf8. If there are only
ascii charachters in the file, there is no reason for the file command
to say anything else but us-ascii. There is no difference between
ascii and utf8, in case there are only ascii characters in the file.


Thanks, I realized it afterwards by trial and error.
I was misled by this diff:

$ git diff
diff --git a/ftp/ScriabinA/O59/prelude/prelude.ly 
b/ftp/ScriabinA/O59/prelude/prelude.ly

index ccb31de..b66a87f 100644
--- a/ftp/ScriabinA/O59/prelude/prelude.ly
+++ b/ftp/ScriabinA/O59/prelude/prelude.ly
@@ -38,7 +38,7 @@ upperOne = \relative c' {
  a e' a8-- gis' gis'4- cis, bis'4.-- |
  a a'4-- gis' gis'8- cis, bis'4.-- |
  a a'4-- gis' gis'8- a, a'4-- gis' gis'8- |
- r r gis bis gis'-\p\^\markup{\italic avec d\\'efi} gis bis 
gis'- gis bis gis'- gis bis gis'-\! |
+ r r gis bis gis'-\p\^\markup{\italic avec dC3A9fi} gis bis 
gis'- gis bis gis'- gis bis gis'-\! |

  \tieUp
  gis'-\f e8.- dis16- gis4.- ~ |
  gis4 e8- dis- bis- a- |
@@ -72,7 +72,7 @@ upperOne = \relative c' {
  ees ees'4-- d' d'8- ees, ees'4-- d' d'8- |
  r r d fis d'-\p\ d fis d'- d fis d'- d fis d'-\! |
  \tieUp
- d d'-\f^\markup{\italic avec d\\'efi} bes bes'-- a a'-- d 
d'4.- ~ |
+ d d'-\f^\markup{\italic avec dC3A9fi} bes bes'-- a a'-- 
d d'4.- ~ |

  d d'4 bes bes'8- a a'- fis fis'- ees ees'- |
  \phrasingSlurDown
  fis bes ees fis4.- bes,16\( ees fis bes d ees |

I see now that it is because of LESSCHARSET env. This fixes it:
export LESSCHARSET=utf-8


___
Mutopia-discuss mailing list
Mutopia-discuss@mutopiaproject.org
http://lists.bcn.mythic-beasts.com/mailman/listinfo/mutopia-discuss