خرید بک لینک

Vote count: 0

I am working on a web scraping program that feeds into a database, and I have been having problems with UTF-8. Initially, I scraped the data and noticed the special characters were not coming through, so I found that using Encoding() <- "UTF-8" worked.

htmlpage2 <- read_html("http://www.wines.com/wine-varietals/")
allwines <- data.frame(Wine=html_text(html_nodes(htmlpage2, "h5")),
                   Description=html_text(html_nodes(htmlpage2, "h5+ p")),
                   stringsAsFactors=FALSE)
Encoding(allwines$Wine) <- "UTF-8"
Encoding(allwines$Description) <- "UTF-8"

When I created the table in my db, however, the special characters had reverted back.

db <- dbCoect(SQLite(), dbname="WineDB.sqlite")
dbWriteTable(db, "AllWines", allwines, row.names=FALSE, overwrite=TRUE)

Is there a way to change it once for the entire program, even in the database?

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: دوشنبه 6 ارديبهشت 1395 ساعت: 1:32

صفحه بندی