Sha256: a6a96919477fdb8d44c30ca1835e31d82eb1f1c17aff6268f6b6490c1c056aca
Contents?: true
Size: 328 Bytes
Versions: 19
Compression:
Stored size: 328 Bytes
Contents
class Uri # def self.escape_raw(st) st.gsub(/([^a-zA-Z0-9_\-\.~])/) { "%#{$1.unpack('H*')[0].scan(/../).join('%').upcase }" } end # # usage # @search_tag = Uri.unescape_raw(params[:tag]).toutf8 # def self.unescape_raw(st) st.tr('+',' ').gsub(/%([A-Fa-f0-9][A-Fa-f0-9])/) { [$1.hex].pack('C') } end end
Version data entries
19 entries across 19 versions & 3 rubygems