From: Jeremy Bopp Date: 2011-02-16T00:42:40+09:00 Subject: Re: Cann't require UTF-8 files. On 2/14/2011 8:05 PM, Clifford Heath wrote: > Is there a good reason why Ruby can't just detect a UTF-8 BOM? > It's still "metadata" but a lot of tools deal with it. Using a BOM would break shebang processing. It's not a problem for Windows users of Ruby since the shebang line is ignored there, but it would break things for all Unix-like platforms (including Cygwin) where a script can be run directly as a program: http://en.wikipedia.org/wiki/Shebang_%28Unix%29#As_magic_number My personal preference would be for a single multi-byte encoding to be selected for all Ruby files. This would make it easier to configure an editor or source visualizer to handle a file appropriately without the need to replicate Ruby's encoding detection. One downside though is that existing scripts encoded differently may be broken for this hypothetical Ruby's consumption. Using the magic comment to mark the encoding is probably the least disruptive solution overall. -Jeremy