From: Robert Klemme Date: 2005-11-30T00:17:29+09:00 Subject: Re: File.new and encoding Achim Domma (SyynX Solutions GmbH) wrote: > Hi, > > I'm still quite new to ruby, but have written a simple code generator. > The generator opens some files and combines them to a new one. The > resulting file is encoded as iso-8859-1, but it looks like ruby writes > an UTF-8 Markter to the beginning of the file. Is that possible? What's an UTF-8 marker? I know only two byte UTF-16 marker but AFAIK there is no marker for UTF-8. Did I miss something? > How can I tell ruby which encoding to use, if I write to textfiles? > > Any pointers to documentation are wellcome, but I didn't find > something usefull using google. Encoding is not an easy issue with ruby - I guess by default it uses the default enconding of your environment. But you can specify certain (Japanese) encodings with command line option -K. HTH Kind regards robert