urlencode - How to URL Encode a Backslash with R/RCurl -


I am currently trying to encode a string to enter in a URL. My problem is that it is failing when my string has a backslash; I have tried 4 methods with the URLXcode, Curl Escape (RQLL), and the functions of the Colp Surface Encoded (RQRL), but none of them Has not succeeded too.

  & gt; URLencode ("hello \ hello") error: An unknown stroke in the character string that starts with '\ h', hello \ h "" curlEscape ("hello \ hello") error: 'one in the' h 'character Unrecognized luck is the string "hello \ h" & gt; curlscentcentcode ("hello \ hello") error: '\ h' 'hello \ h' & gt; curlPercentEncode ("hello \ hello \", amp = TRUE) There is an unfamiliar fortune in the character string: 'H' is a Hello \ "" "   

You

  & gt; URLencode ("Hello \\ Hello \") [1] "Hello% 5Chello"   

The error that you are getting is not from any action that you tried to call ; Actually none of them got this until the time they were called. The error is from R's parser backslash string literals are a special character for themselves, so that you can write a double backslash in your string to create a backslash string value (There are many other things that you can keep useful after backslash; For example, "\" " is that you meet a string value with a double-coat letter. Quote for more information Since this is a problem with string literals syntax, if you are reading the data "string to enter in the URL" then it should not come to the source; if you want to remove this string If you want to write directly in your code, then it should only be an issue.

Comments

Popular posts from this blog

Out of index C/C++ -

regex - PatternSyntaxException: while using String.ReplaceAll function in java? -

java - Projects which are accessed via multiple (different) IDEs: Ant or Maven? -