Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixed nokogiri encoding

  • Loading branch information...
commit 8f961f84c46c4c2947c664e1439a7fb94966acc4 1 parent e864df4
@frsyuki frsyuki authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 update-index.rb
View
6 update-index.rb
@@ -1,3 +1,4 @@
+# encoding: utf-8
require 'rest-client'
require 'json'
require 'cgi'
@@ -28,9 +29,10 @@ def get_quickstart_html(repo_url)
DOC_FILES.each {|fname|
begin
if fname.include?('.')
- data = RestClient.get("#{repo_url}/blob/master/#{fname}")
+ url = "#{repo_url}/blob/master/#{fname}"
+ data = RestClient.get(url)
begin
- html = Nokogiri::HTML(data).css('.file')[0].xpath('div').last.to_s
+ html = Nokogiri::HTML::Document.parse(data, url, 'UTF-8').css('.file')[0].xpath('div').last.to_s
rescue
break # fail & skip
end
Please sign in to comment.
Something went wrong with that request. Please try again.