https://bugs.ruby-lang.org/https://bugs.ruby-lang.org/favicon.ico?17113305112017-09-24T14:29:46ZRuby Issue Tracking SystemRuby master - Feature #13934: [Feature request] Being able to set a default encoding other than Unicode on a "per-project" basishttps://bugs.ruby-lang.org/issues/13934?journal_id=668582017-09-24T14:29:46Zphluid61 (Matthew Kerwin)matthew@kerwin.net.au
<ul></ul><p>If it's a method, that means you have to parse the file and execute it, before you can know how to parse it ..?</p> Ruby master - Feature #13934: [Feature request] Being able to set a default encoding other than Unicode on a "per-project" basishttps://bugs.ruby-lang.org/issues/13934?journal_id=668622017-09-25T05:18:22Znaruse (Yui NARUSE)naruse@airemix.jp
<ul></ul><p>In addition to what Matthew and Yui said, I have some more questions:</p>
<p>What about files with more than one module, or with code outside a module and code inside the module?</p>
<p>Are you planning to have actual content e.g. in Latin-1 in one of these files? What happens to that content if the encoding is changed? If you yourself don't plan this, what should happen in this case, anyway?</p>
<p>If the content of the file is in fact only US-ASCII, then Ruby is quite permissive in combining this with data that is ASCII-compatible. Where do you have actual specific problems?</p>
<p>"Your project" isn't an island. How do you plan to make sure that this project works together with libraries that don't assume the same encoding?</p>
<p>What about projects that use more than one module? Or no module?</p>
<p>What about having an option on the ruby command for this functionality?</p>