gagolews / stringi

Fast and portable character string processing in R (with the Unicode ICU)
https://stringi.gagolewski.com/
Other
304 stars 44 forks source link

stringi_trans_general issue when read from any file #411

Closed rrudra46 closed 3 years ago

rrudra46 commented 3 years ago

I want to achieve something like: stri_trans_general('Man\u00e9', 'latin-ascii') --> "Mané" but after the contents are read from a file.

An example is as below: x = read.table("file.txt") where the file contains this: Man\u00e9 But on stri_trans_general(x, 'latin-ascii'), I achieve this: "Man\u00e9"

gagolews commented 3 years ago

A call to stringi::stri_unescape_unicode() should do the trick, I reckon.

rrudra46 commented 3 years ago

It worked. Thanks. 👍