Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed nokogiri encoding

  • Loading branch information...
commit 8f961f84c46c4c2947c664e1439a7fb94966acc4 1 parent e864df4
FURUHASHI Sadayuki authored July 01, 2013

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

  1. 6  update-index.rb
6  update-index.rb
... ...
@@ -1,3 +1,4 @@
  1
+# encoding: utf-8
1 2
 require 'rest-client'
2 3
 require 'json'
3 4
 require 'cgi'
@@ -28,9 +29,10 @@ def get_quickstart_html(repo_url)
28 29
   DOC_FILES.each {|fname|
29 30
     begin
30 31
       if fname.include?('.')
31  
-        data = RestClient.get("#{repo_url}/blob/master/#{fname}")
  32
+        url = "#{repo_url}/blob/master/#{fname}"
  33
+        data = RestClient.get(url)
32 34
         begin
33  
-          html = Nokogiri::HTML(data).css('.file')[0].xpath('div').last.to_s
  35
+          html = Nokogiri::HTML::Document.parse(data, url, 'UTF-8').css('.file')[0].xpath('div').last.to_s
34 36
         rescue
35 37
           break  # fail & skip
36 38
         end

0 notes on commit 8f961f8

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