Closed amanka closed 4 years ago
In R (not just in stringi), you just can't insert a NUL character (ASCII/UTF8 code == 0) into a string, as it encodes the end of a string internally.
See https://en.wikipedia.org/wiki/Null_character and https://en.wikipedia.org/wiki/Null-terminated_string
HTH
I think I found an error in
stringi::stri_rand_strings
.I'm running this:
stringi::stri_rand_strings(n = n, length = 8, pattern = "[\\u0000-\\U0010ffff]")
Note: I'm using two backslashes
\\
and not one. If I do 1, I get this:When debugging it, I can follow it to here:
Which produces:
Error in debug(myfunc()) : could not find function "<U+0005F8EB><U+00066763><U+5724><U+000AC2C4><U+000F9977><U+000C9951><U+00095750><U+0003C371>"
The error doesn't always happen, the probability of occurrence seems to increase with n. Here is some sample output.
I can't find
C_stri_rand_strings
(presumably C code) in this repo, so I can't investigate further.