Skip to content

Instantly share code, notes, and snippets.

@DATAUNIRIO
Created October 30, 2025 14:08
Show Gist options
  • Select an option

  • Save DATAUNIRIO/bda40212cca513f9a99390060cc5557f to your computer and use it in GitHub Desktop.

Select an option

Save DATAUNIRIO/bda40212cca513f9a99390060cc5557f to your computer and use it in GitHub Desktop.
como corrigir erro de encoding
iconv(Titanic$Classe, "latin1", "UTF-8")
library(stringi)
# Seu texto com problema
texto <- "Tripula\xe7\xe3o"
# Converter escapes Unicode para caracteres
texto_corrigido <- stri_unescape_unicode(gsub("\\\\x", "\\\\u00", texto))
print(texto_corrigido)
# [1] "Tripulação"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment