EVOLUTION-MANAGER
Edit File: native_encode.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: Try to use the system native encoding to represent a...</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 native_encode {xfun}"><tr><td>native_encode {xfun}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Try to use the system native encoding to represent a character vector</h2> <h3>Description</h3> <p>Apply <code>enc2native()</code> to the character vector, and check if <code>enc2utf8()</code> can convert it back without a loss. If it does, return <code>enc2native(x)</code>, otherwise return the original vector with a warning. </p> <h3>Usage</h3> <pre> native_encode(x, windows_only = is_windows()) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x</code></td> <td> <p>A character vector.</p> </td></tr> <tr valign="top"><td><code>windows_only</code></td> <td> <p>Whether to make the attempt on Windows only. On Unix, characters are typically encoded in the native encoding (UTF-8), so there is no need to do the conversion.</p> </td></tr> </table> <h3>Examples</h3> <pre> library(xfun) s = intToUtf8(c(20320, 22909)) Encoding(s) s2 = native_encode(s) Encoding(s2) </pre> <hr /><div style="text-align: center;">[Package <em>xfun</em> version 0.16 <a href="00Index.html">Index</a>]</div> </body></html>