I have a text file which contains some kind of fallback conversions of Unicode characters (the Unicode code points in angle brackets). So it contains e.g. foo
foo
Perhaps:
library(stringi) library(magrittr) "foobar and cray" %>% stri_replace_all_regex("", "\\\\u$1") %>% stri_unescape_unicode() %>% stri_enc_toutf8() ## [1] "foošbar and cražy"
may work (I don't need the last conversion on macOS but you may on Windows).