From: Alain Matthes Date: 2010-12-30T18:05:21+09:00 Subject: Re: From python to ruby 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 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. Best regards AM