链接中中文处理方法

URI.escape(keyword)

link = "http://search.21so.com/?query=#{URI.escape(keyword)}&offset=#{page}"

 

URI.encode()

URI.encode(request.base_url + "/api/map_url?lat=#{lat}&lng=#{lng}&name=#{name}&address=#{address}")

posted @ 2013-12-10 19:56  小狸的窝  阅读(398)  评论(0编辑  收藏  举报