Created
December 2, 2017 09:27
-
-
Save privefl/b8d4dd772430b72b99dc6027fdbf1cfb to your computer and use it in GitHub Desktop.
Convert unicode in HTML to hexa.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unicode2hex <- function(html_file) { | |
new_text <- gsub(pattern = "<U\\+([0-9]{4})>", replacement = "&#x\\1", | |
x = readLines(html_file, encoding = "UTF-8")) | |
writeLines(new_text, con = html_file, useBytes = TRUE) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment