Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

pulling a switcheroo for character conversion

  • Loading branch information...
commit 0f5a1b65f9123448e2c8a081a427789403cd6303 1 parent ee3f6bb
@vbatts authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/feed_tools/helpers/uri_helper.rb
View
7 lib/feed_tools/helpers/uri_helper.rb
@@ -39,8 +39,11 @@ def self.idn_enabled?
if @idn_enabled.nil? || @idn_enabled == false
@idn_enabled = false
begin
+ require 'base64'
require 'idn'
- if IDN::Idna.toASCII('http://www.詹姆斯.com/') ==
+ # 'http://www.詹姆斯.com/'
+ b64_str = Base64.decode64('aHR0cDovL3d3dy7oqbnlp4bmlq8uY29tLw==\n')
+ if IDN::Idna.toASCII(b64_str) ==
"http://www.xn--8ws00zhy3a.com/"
@idn_enabled = true
else
@@ -216,4 +219,4 @@ def self.is_uri?(url)
return true
end
end
-end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.