Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See the exact byte sequence of an R string?

Tags:

string

r

unicode

How can I get the byte sequence of a particular UTF-8 string? I'm seeing what looks like some bug in the regex engine which is only triggered in some edge cases, and I'd like to know exactly what data it's working on.

like image 331
Ken Williams Avatar asked Sep 16 '10 18:09

Ken Williams


2 Answers

Maybe charToRaw?

> charToRaw("R-string")
[1] 52 2d 73 74 72 69 6e 67
like image 167
Joshua Ulrich Avatar answered Oct 05 '22 23:10

Joshua Ulrich


Also check out the hexView package by none other than Paul Murrell.

like image 45
Jeff Avatar answered Oct 05 '22 23:10

Jeff