あんパン

こしあん派

2013-02-25から1日間の記事一覧

RubyでencodeURIComponent

http://rubyist.g.hatena.ne.jp/edvakf/20090226/1235672230でいけるかと思いつつ少々不安だったので実際に比べてみたらやっぱり違っていた。 結果から言うと require 'URI' string = 'str' p URI.escape(string,/[^-_.!~*'()a-zA-Z\d]/u) でいける。 上のリ…