I'm currently trying to encode a string for insertion into a URL. My issue is that this seems to fail when my string contains a backslash. I've tried 4 approaches so far using the URLencode, curlEscape (from RCurl), and curlPercentEncode (from RCurl) functions, but none of them have been successful.
> URLencode("hellohello")
Error: 'h' is an unrecognized escape in character string starting ""helloh"
> curlEscape("hellohello")
Error: 'h' is an unrecognized escape in character string starting ""helloh"
> curlPercentEncode("hellohello")
Error: 'h' is an unrecognized escape in character string starting ""helloh"
> curlPercentEncode("hellohello", amp=TRUE)
Error: 'h' is an unrecognized escape in character string starting ""helloh"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…