R中的 url编码 和 解码

 

URL编码 :

##  URLencode2 = function( str = '' )

a = URLencode( iconv( str,  to = 'utf8',  toRaw = F ) )

a就是编码后的字符串 

 

解码   加载 urltools 包

b = urltools::url_decode( 编码后的字符串 )

Encoding( b)  = 'UTF-8'

b 就是解码后的字符串

 

posted on 2018-09-29 10:45  michael_YM  阅读(417)  评论(0编辑  收藏  举报

导航