| read_lines_any_encoding | R Documentation |
EndNote / Web of Science / Zotero RIS and CSV exports on Windows are frequently Windows-1252 or Latin-1, not UTF-8. Hardcoding encoding = "UTF-8" caused readLines to mark strings as UTF-8 even when bytes were invalid, and downstream grepl/regexpr threw "input string N is invalid in this locale". Try encodings in descending likelihood and return the first that decodes cleanly.
read_lines_any_encoding(path)
path |
File path. |
Character vector of lines.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.