Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #5 from andykent/patch-1

Allow changing of encoding
  • Loading branch information...
commit 15cb43c486ed4a4353112b929041b3ad8a84fdc3 2 parents dd14a86 + 31ae812
Andrew Cantino authored

Showing 1 changed file with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. 6  lib/readability.rb
6  lib/readability.rb
@@ -9,7 +9,8 @@ class Document
9 9
       :remove_unlikely_candidates => true,
10 10
       :weight_classes => true,
11 11
       :clean_conditionally => true,
12  
-      :remove_empty_nodes => true
  12
+      :remove_empty_nodes => true,
  13
+      :encoding => 'UTF-8'
13 14
     }.freeze
14 15
 
15 16
     attr_accessor :options, :html
@@ -20,11 +21,12 @@ def initialize(input, options = {})
20 21
       @remove_unlikely_candidates = @options[:remove_unlikely_candidates]
21 22
       @weight_classes = @options[:weight_classes]
22 23
       @clean_conditionally = @options[:clean_conditionally]
  24
+      @encoding = @options[:encoding]
23 25
       make_html
24 26
     end
25 27
 
26 28
     def make_html
27  
-      @html = Nokogiri::HTML(@input, nil, 'UTF-8')
  29
+      @html = Nokogiri::HTML(@input, nil, @encoding)
28 30
     end
29 31
 
30 32
     REGEXES = {

0 notes on commit 15cb43c

Please sign in to comment.
Something went wrong with that request. Please try again.