Sha256: 0e4b149722b91ffefb31638f9995dfa453be9f5decf7dc6243eaceb1ea249733

Contents?: true

Size: 569 Bytes

Versions: 7

Compression:

Stored size: 569 Bytes

Contents

require 'feedparser/textconverters'

# Patch for REXML
# Very ugly patch to make REXML error-proof.
# The problem is REXML uses IConv, which isn't error-proof at all.
# With those changes, it uses unpack/pack with some error handling
module REXML
  module Encoding
    def decode(str)
      return str.toUTF8(@encoding)
    end

    def encode(str)
      return str
    end

    def encoding=(enc)
      return if defined? @encoding and enc == @encoding
      @encoding = enc || 'utf-8'
    end
  end

  class Element
    def children
      @children
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
ruby-feedparser-0.9.5 lib/feedparser/rexml_patch.rb
ruby-feedparser-0.9.4 lib/feedparser/rexml_patch.rb
ruby-feedparser-0.9.3 lib/feedparser/rexml_patch.rb
penso-feedparser-0.8 lib/feedparser/rexml_patch.rb
ruby-feedparser-0.7 lib/feedparser/rexml_patch.rb
whistle-0.1.1 vendor/ruby-feedparser-0.5-stripped/lib/feedparser/rexml_patch.rb
whistle-0.1 vendor/ruby-feedparser-0.5-stripped/lib/feedparser/rexml_patch.rb