From: Martin Duerst Date: 2008-10-10T16:23:18+09:00 Subject: [ruby-core:19270] Re: default_internal encoding At 03:11 08/10/10, Dave Thomas wrote: >I'm documenting default_internal for the PickAxe, and have a couple of >questions: > >1. Right now I can set it via -E ext:int. However, I don't seem able >to set it via the magic comment. > > # encoding: iso-8859-1:utf-8 > p __ENCODING__ #=> iso-8859-1 > p Encoding.default_internal #=> nil I have followed the ruby-dev discussion fairly closely, but it always revolved around using #!, not some magic comment. Akira and Nobu and me had to convince Matz that it would make sense to merge a setting of -E default-external on the actual command line with a setting -E :default-internal when using #!, because that's what we thought where the information would most probably come from. Using the magic comment wasn't discussed explicitly as far as I remember, and I assume the reasons behind this are that magic comments are a last-resort evil, and that any impression that default_internal would vary per source file would be very wrong. >2. Matz was talking about adding a -U command line option. Will that >be added at some point? This was discussed extensively, and although several people on ruby-dev questioned its utility, my understanding was that Matz will implement this, probably in the next few days. But of course, I'm not speaking for Matz, so I might be wrong (I hope I'll be right :-). Regards, Martin. #-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University #-#-# http://www.sw.it.aoyama.ac.jp mailto:duerst@it.aoyama.ac.jp