Actions
Bug #1683
closedInvalid Source Encodings Raise Vauge Errors
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-06-21 trunk 23774) [i686-linux]
Backport:
Description
=begin
If a non-ASCII compatible source encoding is specified via a magic comment an ArgumentError is raised.
$ ruby -vr/tmp/proxy -e 'p 1'
ruby 1.9.2dev (2009-06-21 trunk 23774) [i686-linux]
/tmp/proxy.rb:1:in `require': UTF-16BE is not ASCII compatible (ArgumentError)
from /tmp/proxy.rb:1:in `<top (required)>'
from ruby:0:in `require'
There two main problems here:
- The problematic magic comment is actually in a file that /tmp/proxy.rb requires, but the error message does not explain this. Especially when using third-party code, it's pretty critical to at least know the file where the error occurs. (Note that when one of the required files has syntax errors, for example, the correct filename and line number is shown).
- For somebody unfamiliar with encodings, this error makes little sense. Naming an ASCII-compatible encoding would be helpful.
=end
Updated by nobu (Nobuyoshi Nakada) almost 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r23837.
=end
Actions
Like0
Like0