Skip to content

Instantly share code, notes, and snippets.

@erikerhardt
Last active February 26, 2024 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikerhardt/1da5262ce2c64178418860226e9c3df9 to your computer and use it in GitHub Desktop.
Save erikerhardt/1da5262ce2c64178418860226e9c3df9 to your computer and use it in GitHub Desktop.
[^\x00-\x7F]
To fix this, you have to find the Unicode and replace it with it’s ASCII equivalent. To do this: Ctrl-F to find, search for “[^\x00-\x7F]” (without quotes), select “Regex” for regular expressions, and find the “Next” one.
# Replace unicode in all variables
dat_all <-
dat_all |>
dplyr::mutate(
dplyr::across(
.cols = everything()
, .fns = ~ e_text_unicode_to_ascii(text_in = .x)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment