PAC
PAC

Reputation: 5376

Trying to convert the character encoding in a dataset

I would like to convert the character encoding of one of my variable in a dataset but I don't understand why the iconv command is not working.

My gist file is here : https://gist.github.com/pachevalier/5850660

Upvotes: 0

Views: 658

Answers (1)

Suz
Suz

Reputation: 3802

Two ideas come to mind:
1) you have a simple problem and are asking the wrong question

-- the final line in your Gist is
Encoding(tab$fiche_communale$Nom)
Are you actually wanting:
Encoding(tab$fiche_communale$name)

2) readHTMLTable may not be reading in the character encoding correctly, in which case, you could set it explicitly with Encoding(tab$fiche_communale$Nom) <- "latin-1"

3) try relying on iconv to detect the local encoding:
iconv(tab$fiche_communale$Nom, from="", to="UTF-8")

Upvotes: 2

Related Questions