Hi,
I'm trying to convert the emojis in my document to text.
Here is an example :
text=C'est juste enorme ce son <U+0001F44C><U+0001F44C>
tt<- iconv(text, from ="latin1", to = "ASCII", sub = "byte")
replace_emoji(tt)
"C'est juste enorme ce son <U+0001F44C><U+0001F44C>"
Apparently, it didn't work! Could anyone help me to solve this problem, please?
Bests
Any solution plz?
text=C'est juste enorme ce son <U+0001F44C><U+0001F44C>
tt<- iconv(text, from ="latin1", to = "ASCII", sub = "byte")
replace_emoji(tt)
"C'est juste enorme ce son <U+0001F44C><U+0001F44C>"
Apparently, it didn't work! Could anyone help me to solve t
I don't know where your source text came from but using another syntax for your UTF8 char it works
text="C'est juste enorme ce son \U0001F44C\U0001F44C>"
textclean::replace_emoji(text)
#> [1] "C'est juste enorme ce son OK hand OK hand >"
# You could convert from the <U+ > form
text2 <- "C'est juste enorme ce son <U+0001F44C><U+0001F44C>"
text2 <- gsub("<U\\+([A-Z0-9]+)>", "\\\\U\\1", text2)
textclean::replace_emoji(stringi::stri_unescape_unicode(text2))
#> [1] "C'est juste enorme ce son OK hand OK hand "
Created on 2020-04-11 by the reprex package (v0.3.0.9001)
If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: