From: David Flanagan Date: 2007-10-26T15:16:22+09:00 Subject: Re: Hopefully Complete List of Possible Encoding Specifications - Existing Ones Wolfgang N��dasi-Donner wrote: > C:\primary>ruby19 --encoding=utf-8 ascii_encoded.rb > Encoding.primary_encoding: > Encoding.primary_encoding: > contents.encoding: > contents.length: 38 > contents.bytesize: 38 > > ..., which means, that the data is read in ascii encoding. This > is exactly what Matz wrote (if I didn't a mistake in understanding). > What does (or should) the primary encoding do in this example? > > Wolfgang N��dasi-Donner > Nobu says: > * IO instance created by open method with no encoding spec, > * pathnames returned by DDir.pwd, etc, and > * strings returned by ENV.keys, ENV.[], etc, > will have the primary encoding. Note the future tense, though. The File.open method doesn't allow you to explicitly specify an encoding yet. And it doesn't implicitly use the primary encoding either. My assumption is that this is coming, but isn't done yet. David