EVOLUTION-MANAGER
Edit File: localeToCharset.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: Select a Suitable Encoding Name from a Locale Name</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 localeToCharset {utils}"><tr><td>localeToCharset {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2> Select a Suitable Encoding Name from a Locale Name </h2> <h3>Description</h3> <p>This functions aims to find a suitable coding for the locale named, by default the current locale, and if it is a UTF-8 locale a suitable single-byte encoding. </p> <h3>Usage</h3> <pre> localeToCharset(locale = Sys.getlocale("LC_CTYPE")) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>locale</code></td> <td> <p>character string naming a locale.</p> </td></tr> </table> <h3>Details</h3> <p>The operation differs by OS. </p> <dl> <dt>On Windows,</dt><dd><p>a locale is specified like <code>"English_United Kingdom.1252"</code>. The final component gives the codepage, and this defines the encoding. </p> </dd> <dt>On Unix-alikes:</dt><dd> <p>Locale names are normally like <code>es_MX.iso88591</code>. If final component indicates an encoding and it is not <code>utf8</code> we just need to look up the equivalent encoding name. Otherwise, the language (here <code>es</code>) is used to choose a primary or fallback encoding. </p> </dd> </dl> <p>In the <code>C</code> locale the answer will be <code>"ASCII"</code>. </p> <h3>Value</h3> <p>A character vector naming an encoding and possibly a fallback single-encoding, <code>NA</code> if unknown. </p> <h3>Note</h3> <p>The encoding names are those used by <code>libiconv</code>, and ought also to work with <code>glibc</code> but maybe not with commercial Unixen. </p> <h3>See Also</h3> <p><code><a href="../../base/html/locales.html">Sys.getlocale</a></code>, <code><a href="../../base/html/iconv.html">iconv</a></code>. </p> <h3>Examples</h3> <pre> localeToCharset() </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>