https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112012-01-08T17:35:50ZRuby Issue Tracking SystemRuby master - Bug #5862: Strings not encoded in -E encodinghttps://redmine.ruby-lang.org/issues/5862?journal_id=231682012-01-08T17:35:50Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li><li><strong>Category</strong> set to <i>M17N</i></li></ul><p>=begin</p>
<p>Ruby has three types of default encodings, internal, external, and<br>
source-code (which (({<strong>ENCODING</strong>})) equals to), and they are<br>
independent each others. (({-E})) option sets the former two, but<br>
does nothing for source-code encoding.</p>
<p>If you want to set source-code encoding in (({-e})), try:</p>
<p>$ ruby -e'#encoding:ascii-8bit' -e 'p <strong>ENCODING</strong>'</p>
<p>=end</p> Ruby master - Bug #5862: Strings not encoded in -E encodinghttps://redmine.ruby-lang.org/issues/5862?journal_id=231692012-01-08T18:25:13Zbrixen (Brian Shirai)brixen@gmail.com
<ul></ul><p>Just to be clear, the -K options do set the source-code encoding, right?</p>
<p>Thanks,<br>
Brian</p> Ruby master - Bug #5862: Strings not encoded in -E encodinghttps://redmine.ruby-lang.org/issues/5862?journal_id=231702012-01-08T19:55:01Znobu (Nobuyoshi Nakada)nobu@ruby-lang.org
<ul></ul><p>Brian Ford wrote:</p>
<blockquote>
<p>Just to be clear, the -K options do set the source-code encoding, right?</p>
</blockquote>
<p>Yes, it sets all of three.<br>
Sorry that I forgot to mention about it.</p> Ruby master - Bug #5862: Strings not encoded in -E encodinghttps://redmine.ruby-lang.org/issues/5862?journal_id=231712012-01-08T20:25:50Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>When we design the system, -e is used through a console (terminal emulator).<br>
So -e follows the consoles's encoding, and it is assumed to be the locale encoding.<br>
So -E doesn't effect.</p>
<p>-K intends for compatibility.<br>
It effects all encodings except default internal.</p>