Ticket #89 (closed defect: fixed)

Opened 2 years ago

Last modified 18 months ago

REXML::ParseException on xml with encoding=CP-1252

Reported by: jl Owned by: ser
Priority: normal Milestone: 3.1.7
Component: Other Version: 3.1.4
Severity: normal Keywords:
Cc: Ruby version: Other
Operating system: Linux

Description

csegrad:~ 26$ ruby -vrrexml/rexml -e 'p REXML::VERSION,PLATFORM'
ruby 1.8.5 (2006-08-25) [i686-linux]
"3.1.4"
"i686-linux"

csegrad:~ 27$ cat a.xml
<?xml version="1.0" encoding="CP-1252" ?>
<xml><foo></foo></xml>

csegrad:~ 28$ irb
irb(main):001:0> require "rexml/document"; doc = REXML::Document.new File.open("a.xml")
REXML::ParseException?: #<NoMethodError?: undefined method `[]' for nil:NilClass>
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/encoding.rb:9:in `apply'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/encoding.rb:39:in `encoding='
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/source.rb:47:in `encoding='
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/parsers/baseparser.rb:203:in `pull'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/parsers/treeparser.rb:21:in `parse'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/document.rb:190:in `build'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/document.rb:45:in `initialize'
(irb):1:in `new'
(irb):1:in `irb_binding'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/irb/workspace.rb:52:in `irb_binding'
/home/j2lau/arch/Linux_i686/lib/ruby/1.8/rexml/attribute.rb:99[[BR]] ...

Change History

Changed 2 years ago by ser

  • status changed from new to assigned
  • milestone set to 3.1.7

Changed 18 months ago by ser

  • status changed from assigned to closed
  • resolution set to fixed

Fixed by changeset:1280. ISO-8859-15 had the same issue.

Changed 18 months ago by ser

It wasn't changeset 1280 that fixed this, but rather changeset:1255. I got confused by SVK.

Note: See TracTickets for help on using tickets.