Robert Klemme wrote:
> On 27.07.2010 18:47, Mike Pe wrote:
>>>> parse properly with this line in the beginning of my input file.
>>>
>>> It seems there is no UTF-16 support:
>>>
>>> irb(main):009:0>  f=File.open "x", "r:UTF-16"
>>> (irb):9: warning: Unsupported encoding UTF-16 ignored
>>> =>  #<File:x>
>>>
>>> So there is no point in trying to import a UTF-16 encoded file in Ruby.
> 
>> As for the code that I am using, I simplified the code in my original
>> post. The first line:
>>
>> doc = REXML::Document.new error
> 
> What is "error"?  How do you obtain it?


By "error", I meant my file called error from my first post:

error = <<EOF
     <?xml version="1.0" encoding="UTF-16"?>
     <document test="yes">
     </document>
EOF

> 
>> I tried converting all of the files to UTF-8 and they still did not
>> work. (If you remove the extra line, it does work) I do not think the
>> problem with is in the unicode.
> 
> Hmm...
> 
>   robert


-- 
Posted via http://www.ruby-forum.com/.