iterationlabs/guess_html_encoding — pull request #1 by simeonwillbanks (2012-03-10 01:33:40+00:00)
Title: Don't send unloaded encodings to String.force_encoding

Here is a stack trace which demonstrates the bug:

Error message
ArgumentError: unknown encoding name - X-MAC-ROMAN
Sample stack trace (show Rails)

…s/guess_html_encoding-0.0.2/lib/guess_html_encoding.rb: 41:in `force_encoding'
…s/guess_html_encoding-0.0.2/lib/guess_html_encoding.rb: 41:in `encode'
…y/1.9.1/gems/ruby-readability-0.5.0/lib/readability.rb: 23:in `initialize'

To fix the bug, GuessHtmlEncoding#encoding_loaded? has been added with tests.

Hope this helps,
Simeon