EVOLUTION-MANAGER
Edit File: html_encoding_guess.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Guess faulty character encoding</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for html_encoding_guess {rvest}"><tr><td>html_encoding_guess {rvest}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Guess faulty character encoding</h2> <h3>Description</h3> <p><code>html_encoding_guess()</code> helps you handle web pages that declare an incorrect encoding. Use <code>html_encoding_guess()</code> to generate a list of possible encodings, then try each out by using <code>encoding</code> argument of <code>read_html()</code>. <code>html_encoding_guess()</code> replaces the deprecated <code>guess_encoding()</code>. </p> <h3>Usage</h3> <pre> html_encoding_guess(x) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A character vector.</p> </td></tr> </table> <h3>Examples</h3> <pre> # A file with bad encoding included in the package path <- system.file("html-ex", "bad-encoding.html", package = "rvest") x <- read_html(path) x %>% html_elements("p") %>% html_text() html_encoding_guess(x) # Two valid encodings, only one of which is correct read_html(path, encoding = "ISO-8859-1") %>% html_elements("p") %>% html_text() read_html(path, encoding = "ISO-8859-2") %>% html_elements("p") %>% html_text() </pre> <hr /><div style="text-align: center;">[Package <em>rvest</em> version 1.0.3 <a href="00Index.html">Index</a>]</div> </body></html>