Ruby

rubyで日本語URLを扱う

More than 1 year has passed since last update.
require 'uri'

url = 'http://sample=日本語テスト'

puts url
url2 =URI.escape(url)
puts url2
=>http://sample=~~~~~~~~~~~~~~~~~~~
=>http://sample=日本語テスト