From: Florian Gilcher Date: 2011-02-16T03:06:19+09:00 Subject: Re: Cann't require UTF-8 files. On Feb 15, 2011, at 4:42 PM, Jeremy Bopp wrote: > Using the magic comment to mark the encoding is probably the least > disruptive solution overall. > > -Jeremy I usually recommend not using UTF-8 in source at all and push all UTF-8 strings into localization files (Either using a heavyweight solution like i18n or just a plain YAML file, if you don't want a dependency). This also circumvents the problem of headers and is good practice. For scripts of smaller scope, I usually skip that rule ;).[2] Ruby still assumes source code to be US-ASCII by default, which I think is a good choice for compatibility reasons.[1] Regards, Florian [1] Which is also the assumption that Ruby 1.8 had, but not as explicit. [2] A neat trick is the following: require "yaml" puts YAML.load(DATA).inspect __END__ --- :test: Some ünicode Data.