EVOLUTION-MANAGER
Edit File: stri_trans_nf.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: Perform or Check For Unicode Normalization</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 stri_trans_nfc {stringi}"><tr><td>stri_trans_nfc {stringi}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Perform or Check For Unicode Normalization</h2> <h3>Description</h3> <p>These functions convert strings to NFC, NFKC, NFD, NFKD, or NFKC_Casefold Unicode Normalization Form or check whether strings are normalized. </p> <h3>Usage</h3> <pre> stri_trans_nfc(str) stri_trans_nfd(str) stri_trans_nfkd(str) stri_trans_nfkc(str) stri_trans_nfkc_casefold(str) stri_trans_isnfc(str) stri_trans_isnfd(str) stri_trans_isnfkd(str) stri_trans_isnfkc(str) stri_trans_isnfkc_casefold(str) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>str</code></td> <td> <p>character vector to be encoded</p> </td></tr> </table> <h3>Details</h3> <p>Unicode Normalization Forms are formally defined normalizations of Unicode strings which, e.g., make possible to determine whether any two strings are equivalent. Essentially, the Unicode Normalization Algorithm puts all combining marks in a specified order, and uses rules for decomposition and composition to transform each string into one of the Unicode Normalization Forms. </p> <p>The following Normalization Forms (NFs) are supported: </p> <ul> <li><p> NFC (Canonical Decomposition, followed by Canonical Composition), </p> </li> <li><p> NFD (Canonical Decomposition), </p> </li> <li><p> NFKC (Compatibility Decomposition, followed by Canonical Composition), </p> </li> <li><p> NFKD (Compatibility Decomposition), </p> </li> <li><p> NFKC_Casefold (combination of NFKC, case folding, and removing ignorable characters which was introduced with Unicode 5.2). </p> </li></ul> <p>Note that many W3C Specifications recommend using NFC for all content, because this form avoids potential interoperability problems arising from the use of canonically equivalent, yet different, character sequences in document formats on the Web. Thus, you will rather not use these functions in typical string processing activities. Most often you may assume that a string is in NFC, see RFC\#5198. </p> <p>As usual in <span class="pkg">stringi</span>, if the input character vector is in the native encoding, it will be automatically converted to UTF-8. </p> <p>For more general text transforms refer to <code><a href="stri_trans_general.html">stri_trans_general</a></code>. </p> <h3>Value</h3> <p>The <code>stri_trans_nf*</code> functions return a character vector of the same length as input (the output is always in UTF-8). </p> <p><code>stri_trans_isnf*</code> return a logical vector. </p> <h3>References</h3> <p><em>Unicode Normalization Forms</em> – Unicode Standard Annex #15, <a href="http://unicode.org/reports/tr15">http://unicode.org/reports/tr15</a> </p> <p><em>Unicode Format for Network Interchange</em> – RFC\#5198, <a href="http://tools.ietf.org/rfc/rfc5198.txt">http://tools.ietf.org/rfc/rfc5198.txt</a> </p> <p><em>Character Model for the World Wide Web 1.0: Normalization</em> – W3C Working Draft, <a href="http://www.w3.org/TR/charmod-norm/">http://www.w3.org/TR/charmod-norm/</a> </p> <p><em>Normalization</em> – ICU User Guide, <a href="http://userguide.icu-project.org/transforms/normalization">http://userguide.icu-project.org/transforms/normalization</a> (technical details) </p> <p><em>Unicode Equivalence</em> – Wikipedia, <a href="http://en.wikipedia.org/wiki/Unicode_equivalence">http://en.wikipedia.org/wiki/Unicode_equivalence</a> </p> <h3>See Also</h3> <p>Other transform: <code><a href="stri_trans_char.html">stri_trans_char</a>()</code>, <code><a href="stri_trans_general.html">stri_trans_general</a>()</code>, <code><a href="stri_trans_list.html">stri_trans_list</a>()</code>, <code><a href="stri_trans_casemap.html">stri_trans_tolower</a>()</code> </p> <h3>Examples</h3> <pre> stri_trans_nfd("\u0105") # Polish a with ogonek -> a, ogonek stri_trans_nfkc("\ufdfa") # 1 codepoint -> 18 codepoints </pre> <hr /><div style="text-align: center;">[Package <em>stringi</em> version 1.4.6 <a href="00Index.html">Index</a>]</div> </body></html>