File#open ignores Encoding.default_external
-------------------------------------------
Key: JRUBY-5803
URL: http://jira.codehaus.org/browse/JRUBY-5803
Project: JRuby
Issue Type: Bug
Components: Ruby 1.9.2, Ruby 1.9.3
Affects Versions: JRuby 1.6.1, JRuby 1.6, JRuby 1.6RC3, JRuby 1.6RC2, JRuby
1.6RC1, JRuby 1.5.6
Reporter: Reto Schüttel
Assignee: Thomas E Enebo
We've xperienced problems with erb templates containing utf-8 characters with
jruby in 1.9 mode. It turns out that File#open doesn't honor the setting
"external default encoding", as it can be seen by the following example:
{code}
Encoding.default_internal = "UTF-8"
Encoding.default_external = "UTF-8"
# Foobar in my case is a file with a single utf-8 char in it,
# but it shouldn't really matter
File.open("foobar") do |fh|
content = fh.read
puts content.encoding # returns ASCII-8BIT
end
{code}
As you can see jruby returns ascii-8bit on our system. Tested with todays
master, 1.6.1 and 1.5.6.
Cheers
Reto Schüttel
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email