Re: [R] cannot base64decode string which is base64encode in R

2013-08-06 Thread Prof Brian Ripley
On 06/08/2013 08:34, Qiang Wang wrote: Thanks for your Elaborative explanation. If I'm understanding correct. "ߟ" belongs to those characters that CAN be interpreted by UTF-8. Others are left as they are, such as, "\xe4" and "\xac". So the following code will show an error message, but it won't

Re: [R] cannot base64decode string which is base64encode in R

2013-08-06 Thread Qiang Wang
Thanks for your Elaborative explanation. If I'm understanding correct. "ߟ" belongs to those characters that CAN be interpreted by UTF-8. Others are left as they are, such as, "\xe4" and "\xac". So the following code will show an error message, but it won't affect the use of x? x <- "\xe4" I have

Re: [R] cannot base64decode string which is base64encode in R

2013-08-05 Thread Enrico Schumann
On Mon, 05 Aug 2013, Qiang Wang writes: >> On Sat, Aug 3, 2013 at 3:49 PM, Enrico Schumann >> wrote: >> >>> On Fri, 02 Aug 2013, Qiang Wang writes: >>> >>> > Hi, >>> > >>> > I'm struggling with encode/decode strings in R. Don't know why the second >>> > example below would fail. Thanks in advan

Re: [R] cannot base64decode string which is base64encode in R

2013-08-04 Thread Qiang Wang
Thanks for your reply! Sorry I did not clarify that I was using base64encode and base64decode functions provide from "caTools" package. It seems that if I convert the string to the raw type first, it still solves my problem. My original problem actually is that I have a string: secret <- '5Kwug+B

Re: [R] cannot base64decode string which is base64encode in R

2013-08-03 Thread Enrico Schumann
On Fri, 02 Aug 2013, Qiang Wang writes: > Hi, > > I'm struggling with encode/decode strings in R. Don't know why the second > example below would fail. Thanks in advance for your help. > succeed: s <- "saf" x <- base64encode(s) y <- base64decode(x, "character") > fail: s <- "safs" x <- base64enco

[R] cannot base64decode string which is base64encode in R

2013-08-02 Thread Qiang Wang
Hi, I'm struggling with encode/decode strings in R. Don't know why the second example below would fail. Thanks in advance for your help. succeed: s <- "saf" x <- base64encode(s) y <- base64decode(x, "character") fail: s <- "safs" x <- base64encode(s) y <- base64decode(x, "character") [[al