Issue Type: Bug Bug
Affects Versions: JRuby 1.7.0.pre1
Assignee: Unassigned
Components: Encoding
Created: 22/Jun/12 2:30 AM
Description:

Reading a UTF-16LE file does not return the correct characters:

Jeffs-MacBook-Pro:~ jeffwilliams$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0]
Jeffs-MacBook-Pro:~ jeffwilliams$ ruby write-utf16le.rb
Jeffs-MacBook-Pro:~ jeffwilliams$ od -t x1 test1
0000000 55 00 54 00 46 00 2d 00 31 00 36 00 4c 00 45 00
0000020 0a 00
0000022
Jeffs-MacBook-Pro:~ jeffwilliams$ ruby read-utf16le.rb
U
T
F
-
1
6
L
E

Jeffs-MacBook-Pro:~ jeffwilliams$ ruby -v
jruby 1.7.0.preview1 (ruby-1.9.3-p203) (2012-05-19 00c8c98) (Java HotSpot(TM) 64-Bit Server VM 1.7.0_05) [darwin-x86_64-java]
Jeffs-MacBook-Pro:~ jeffwilliams$ ruby read-utf16le.rb
U

T

F

-

1

6

L

E

Jeffs-MacBook-Pro:~ jeffwilliams$

Where the relevant files are:

write-utf16le.rb:
File.open("test1", "wb:UTF-16LE") do |f|
f.puts "UTF-16LE"
end

read-utf16le.rb:
File.open("test1", "rb:UTF-16LE") do |f|
f.each_char do |char|
puts char
end
end

Environment: OSX
Project: JRuby
Priority: Major Major
Reporter: Jeff Williams
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
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

Reply via email to