From: w_a_x_man Date: 2010-12-31T09:20:21+09:00 Subject: Re: From python to ruby On Dec 30, 3:02 am, Alain Matthes wrote: > On 2010-12-29 22:05:23 +0100, w_a_x_man said: > > > require 'ftools' > > > HEADER = '\input{Vorspann.ltx} > > > \begin{document} > > > %s > > \end{document} > > ' > > > File.makedirs( "new" ) > > > Dir[ "*.tex" ].each{|fname| > >    text = IO.read( fname ) > >    text2 = HEADER % text > >    File.open( "new/" + fname, "wb" ){|fh| > >     fh.print text2 > >   } > > } > > Hello, > > Very fine! I try with success your code. > > A question :  with python, I've a the line    # -*- coding: utf-8 -*- > Do Ruby works without problem  with utf8 encoding ? I don't know much about utf8. > (I work with Ruby 1.8.7 on OS X.) > > In my case,  input files are in utf8 and I notice  output files >  are also in utf8 with your code.