From: Martin Duerst Date: 2008-10-31T19:05:25+09:00 Subject: [ruby-core:19657] Re: String literal encoding (Was: Default source encoding (Was: [Bug #680] csv.rb: CSV.parse is toolate when encoding is mismatch)) At 18:38 08/10/31, Nobuyoshi Nakada wrote: >Hi, > >At Mon, 27 Oct 2008 21:07:16 +0900, >Nobuyoshi Nakada wrote in [ruby-core:19546]: >> Anyway, I think I understand the needs to specify source >> encoding without magic comments. Is the option for that >> purpose an acceptable solution? > >Here is the patch to add options: Great work! > --encoding=external:internal:source > --external-encoding=enc > --internal-encoding=enc > --source-encoding=enc I personally don't like the last one, and the :source in the first one, but I guess there are situations where they can be very helpful (e.g. testing with different encodings). I also think that it would be good to have the values of --encoding and -E look/work the same, so unless :source already works on -E, I think having just --source-encoding for the case that the source encoding must be set by an option should be okay. This will also make it easier to distinguish in documentation that --source-encoding is really only for very special occasions, and declaring the source encoding in the script itself is strongly preferred. Regards, Martin. #-#-# Martin J. Du"rst, Assoc. Professor, Aoyama Gakuin University #-#-# http://www.sw.it.aoyama.ac.jp mailto:duerst@it.aoyama.ac.jp