kylejginavan/youtube_it — pull request #36 by ciur-eugen (2011-11-28 09:10:33+00:00)
Title: fix unicode searches

class YouTubeIt
def self.esc(s) #:nodoc:
s.to_s.gsub(/[^ [[:word:]].-]+/u){'%'+($&.unpack('H2'*$&.size)*'%').upcase}.tr(' ', '+')
end
end

doesn't encode correctly Unicode characters ($&.unpack('H2') is the problems) to fix this I replaced it with proper method to encode URIs: URI.encode