Guest User

Untitled

a guest
Aug 14th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. char = "LÍNEA"
  2. char2 = "LÍNEA"
  3.  
  4. char == char2
  5. [1] TRUE
  6.  
  7. sub_utf8 <- function(char) {
  8. while(TRUE) {
  9. utf <- str_match(char, '\&\#([0-9]+)\;')[,2]
  10. if (is.na(utf)) break()
  11. char <- str_replace(char, '\&\#([0-9]+)\;', intToUtf8(utf))
  12. }
  13. return(char)
  14. }
  15.  
  16. char = "L&#205;NEA"
  17. char2 = "LÍNEA"
  18. sub_utf8(char) == char2
  19. [1] TRUE
  20.  
  21. char3 = "L&#205;NE&#100;A"
  22. sub_utf8(char3)
  23. [1] "LÍNEdA"
Add Comment
Please, Sign In to add comment