354 lines
28 KiB
HTML
354 lines
28 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<!-- Created by GNU Texinfo 7.0.3, https://www.gnu.org/software/texinfo/ -->
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>Strings (ECL Manual)</title>
|
||
|
|
||
|
<meta name="description" content="Strings (ECL Manual)">
|
||
|
<meta name="keywords" content="Strings (ECL Manual)">
|
||
|
<meta name="resource-type" content="document">
|
||
|
<meta name="distribution" content="global">
|
||
|
<meta name="Generator" content="makeinfo">
|
||
|
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||
|
|
||
|
<link href="index.html" rel="start" title="Top">
|
||
|
<link href="Indexes.html" rel="index" title="Indexes">
|
||
|
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
|
||
|
<link href="Standards.html" rel="up" title="Standards">
|
||
|
<link href="Sequences.html" rel="next" title="Sequences">
|
||
|
<link href="Arrays.html#Arrays" rel="prev" title="Arrays">
|
||
|
<style type="text/css">
|
||
|
<!--
|
||
|
/* colors */
|
||
|
|
||
|
a.copiable-link {visibility: hidden; text-decoration: none; line-height: 0em}
|
||
|
span.r {font-family: initial; font-weight: normal; font-style: normal}
|
||
|
span:hover a.copiable-link {visibility: visible}
|
||
|
strong.def-name {font-family: monospace; font-weight: bold; font-size: larger}
|
||
|
@media (prefers-color-scheme: dark) {
|
||
|
/* dark theme */
|
||
|
html { color: seashell;
|
||
|
background: #1A1A1A; }
|
||
|
body { background: #1A1A1A; }
|
||
|
th { border-bottom: 2px solid lightgray; }
|
||
|
h1, h2, h3, h4, h5 { background-image: linear-gradient(to left, #202020, #3A3A3A); }
|
||
|
code, var, code a { color: darkorange;
|
||
|
background: #2A2A2A; }
|
||
|
a { color: seashell; }
|
||
|
pre { background: #2A2A2A;
|
||
|
color: seashell;
|
||
|
/* mark longer code block with stripe on the left */
|
||
|
border-left: 5px solid darkorange;
|
||
|
padding-left: 10px; }
|
||
|
pre.screen { background: #2A2A2A;
|
||
|
border: 1px solid lightgray; }
|
||
|
pre.programlisting { background: #2A2A2A;
|
||
|
border-left: 1px solid lightgray;
|
||
|
border-top: 1px solid lightgray; }
|
||
|
/* we need a light background in order for the images to be readable */
|
||
|
img { background: white }
|
||
|
}
|
||
|
@media (prefers-color-scheme: light) {
|
||
|
/* light theme */
|
||
|
html { background: white }
|
||
|
body { background: white }
|
||
|
th { border-bottom: 2px solid gray; }
|
||
|
h1, h2, h3, h4, h5 { background: lightgray; }
|
||
|
code, var, code a { color: darkred;
|
||
|
background: whitesmoke; }
|
||
|
a { color: #000; }
|
||
|
pre { background: whitesmoke;
|
||
|
color: black;
|
||
|
/* mark longer code block with stripe on the left */
|
||
|
border-left: 5px solid darkred;
|
||
|
padding-left: 10px; }
|
||
|
pre.screen { background: #EEE;
|
||
|
border: 1px solid black; }
|
||
|
pre.programlisting { background: #EEEEEE;
|
||
|
border-left: 1px solid black;
|
||
|
border-top: 1px solid black; }
|
||
|
}
|
||
|
|
||
|
body {
|
||
|
margin: 1em 125px 0 10%;
|
||
|
line-height: 1.5em;
|
||
|
padding: 0 2em 1em 2em;
|
||
|
font: 13px Verdana,Arial, sans-serif
|
||
|
}
|
||
|
ul, dd, dl, dt { margin-top: 0; margin-bottom: 0; }
|
||
|
p, code, td, dl, dt {
|
||
|
line-height: 1.5em;
|
||
|
}
|
||
|
table {
|
||
|
font: inherit;
|
||
|
border-collapse: collapse;
|
||
|
}
|
||
|
th, td {
|
||
|
vertical-align: top;
|
||
|
}
|
||
|
h1, h2, h3 { padding-left: 15px; }
|
||
|
h4, h5 { padding-left: 5px; }
|
||
|
code, pre {
|
||
|
font-size: 1em;
|
||
|
font-family: monospace;
|
||
|
}
|
||
|
var {
|
||
|
font-size: 1em;
|
||
|
}
|
||
|
/* links inside code appear the same as the code itself */
|
||
|
code a {
|
||
|
font-weight: normal;
|
||
|
text-decoration: none;
|
||
|
}
|
||
|
/* but get an underline when hovering */
|
||
|
code a:hover {
|
||
|
text-decoration: underline;
|
||
|
}
|
||
|
/* ordinary links appear in bold */
|
||
|
a { font-weight: bold; }
|
||
|
pre.verbatim {
|
||
|
margin: 0 0 0 0;
|
||
|
}
|
||
|
pre {
|
||
|
overflow: auto;
|
||
|
}
|
||
|
pre.screen {
|
||
|
font-weight: bold;
|
||
|
padding: 0.5em;
|
||
|
}
|
||
|
pre.programlisting {
|
||
|
padding: 0.5em;
|
||
|
}
|
||
|
div p { padding: 0 2em }
|
||
|
li p { padding: 0; margin: 0 }
|
||
|
hr { display: none; }
|
||
|
div.funcsynopsis p {
|
||
|
text-indent: -2em;
|
||
|
}
|
||
|
div.variablelist {
|
||
|
padding: 0 2em;
|
||
|
}
|
||
|
.type, .funcsynopsis, .symbol {
|
||
|
font-family: monospace;
|
||
|
}
|
||
|
.type, .symbol, .replaceable {
|
||
|
white-space: nowrap;
|
||
|
}
|
||
|
|
||
|
-->
|
||
|
</style>
|
||
|
|
||
|
|
||
|
</head>
|
||
|
|
||
|
<body lang="en">
|
||
|
<div class="section-level-extent" id="Strings">
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Next: <a href="Sequences.html" accesskey="n" rel="next">Sequences</a>, Previous: <a href="Arrays.html#Arrays" accesskey="p" rel="prev">Arrays</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<h3 class="section" id="Strings-1">2.14 Strings</h3>
|
||
|
|
||
|
|
||
|
<ul class="mini-toc">
|
||
|
<li><a href="Strings.html#Strings-_002d-String-types-_0026-Unicode" accesskey="1">String types & Unicode</a></li>
|
||
|
<li><a href="Strings.html#Strings-_002d-C-reference" accesskey="2">C reference</a></li>
|
||
|
</ul>
|
||
|
<hr>
|
||
|
<div class="subsection-level-extent" id="Strings-_002d-String-types-_0026-Unicode">
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Next: <a href="Strings.html#Strings-_002d-C-reference" accesskey="n" rel="next">C reference</a>, Up: <a href="Strings.html#Strings" accesskey="u" rel="up">Strings</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<h4 class="subsection" id="String-types-_0026-Unicode">2.14.1 String types & Unicode</h4>
|
||
|
<p>The ECL implementation of strings is ANSI Common-Lisp compliant. There are basically four string types as shown in <a class="ref" href="Strings.html#tab_003acl_002dstr_002dtypes">Table 2.7</a>. As explained in <a class="ref" href="Characters.html#Characters">Characters</a>, when Unicode support is disabled, <code class="code">character</code> and <code class="code">base-character</code> are the same type and the last two string types are equivalent to the first two.
|
||
|
</p>
|
||
|
<div class="float" id="tab_003acl_002dstr_002dtypes">
|
||
|
|
||
|
<table class="multitable">
|
||
|
<thead><tr><th width="25%">Abbreviation</th><th width="25%">Expanded type</th><th width="50%">Remarks</th></tr></thead>
|
||
|
<tbody><tr><td width="25%">string</td><td width="25%">(array character (*))</td><td width="50%">8 or 32 bits per character, adjustable.</td></tr>
|
||
|
<tr><td width="25%">simple-string</td><td width="25%">(simple-array character (*))</td><td width="50%">8 or 32 bits per character, not adjustable nor displaced.</td></tr>
|
||
|
<tr><td width="25%">base-string</td><td width="25%">(array base-char (*))</td><td width="50%">8 bits per character, adjustable.</td></tr>
|
||
|
<tr><td width="25%">simple-base-string</td><td width="25%">(simple-array base-char (*))</td><td width="50%">8 bits per character, not adjustable nor displaced.</td></tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
<div class="caption"><p><strong class="strong">Table 2.7: </strong>Common Lisp string types</p></div></div>
|
||
|
<p>It is important to remember that strings with unicode characters can only be printed readably when the external format supports those characters. If this is not the case, ECL will signal a <code class="code">serious-condition</code>. This condition will abort your program if not properly handled.
|
||
|
</p>
|
||
|
<hr>
|
||
|
</div>
|
||
|
<div class="subsection-level-extent" id="Strings-_002d-C-reference">
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Previous: <a href="Strings.html#Strings-_002d-String-types-_0026-Unicode" accesskey="p" rel="prev">String types & Unicode</a>, Up: <a href="Strings.html#Strings" accesskey="u" rel="up">Strings</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
<h4 class="subsection" id="C-reference">2.14.2 C reference</h4>
|
||
|
<ul class="mini-toc">
|
||
|
<li><a href="Strings.html#Base-string-constructors" accesskey="1">Base string constructors</a></li>
|
||
|
<li><a href="Strings.html#String-accessors" accesskey="2">String accessors</a></li>
|
||
|
<li><a href="Strings.html#Converting-Unicode-strings" accesskey="3">Converting Unicode strings</a></li>
|
||
|
<li><a href="Strings.html#ANSI-dictionary-2" accesskey="4">ANSI dictionary</a></li>
|
||
|
</ul>
|
||
|
<div class="subsubsection-level-extent" id="Base-string-constructors">
|
||
|
<h4 class="subsubsection">2.14.2.1 Base string constructors</h4>
|
||
|
<a class="anchor" id="ecl_005falloc_005fadjustable_005fbase_005fstring"></a><a class="index-entry-id" id="index-ecl_005falloc_005fadjustable_005fbase_005fstring"></a>
|
||
|
<a class="anchor" id="ecl_005falloc_005fsimple_005fbase_005fstring"></a><a class="index-entry-id" id="index-ecl_005falloc_005fsimple_005fbase_005fstring"></a>
|
||
|
<a class="anchor" id="ecl_005fmake_005fsimple_005fbase_005fstring"></a><a class="index-entry-id" id="index-ecl_005fmake_005fsimple_005fbase_005fstring"></a>
|
||
|
<a class="anchor" id="ecl_005fmake_005fconstant_005fbase_005fstring"></a><a class="index-entry-id" id="index-ecl_005fmake_005fconstant_005fbase_005fstring"></a>
|
||
|
|
||
|
<p>Building strings of C data
|
||
|
</p>
|
||
|
<h4 class="subsubheading" id="Functions-11">Functions</h4>
|
||
|
|
||
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
||
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005falloc_005fadjustable_005fbase_005fstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_alloc_adjustable_base_string</strong> <code class="def-code-arguments">(cl_index length);</code><a class="copiable-link" href='Strings.html#index-ecl_005falloc_005fadjustable_005fbase_005fstring-1'> ¶</a></span></dt>
|
||
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005falloc_005fsimple_005fbase_005fstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_alloc_simple_base_string</strong> <code class="def-code-arguments">(cl_index length);</code><a class="copiable-link" href='Strings.html#index-ecl_005falloc_005fsimple_005fbase_005fstring-1'> ¶</a></span></dt>
|
||
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fsimple_005fbase_005fstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_simple_base_string</strong> <code class="def-code-arguments">(const char* data, cl_fixnum length);</code><a class="copiable-link" href='Strings.html#index-ecl_005fmake_005fsimple_005fbase_005fstring-1'> ¶</a></span></dt>
|
||
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fmake_005fconstant_005fbase_005fstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_make_constant_base_string</strong> <code class="def-code-arguments">(const char* data, cl_fixnum length);</code><a class="copiable-link" href='Strings.html#index-ecl_005fmake_005fconstant_005fbase_005fstring-1'> ¶</a></span></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p><b class="b">Description</b>
|
||
|
</p>
|
||
|
<p>These are different ways to create a base string, which is a string that holds a small subset of characters, the <code class="code">base-char</code>, with codes ranging from 0 to 255.
|
||
|
</p>
|
||
|
<p><code class="code"><a class="ref" href="Strings.html#ecl_005falloc_005fsimple_005fbase_005fstring">ecl_alloc_simple_base_string</a></code> creates an empty string with that much space for characters and a fixed length. The string does not have a fill pointer and cannot be resized, and the initial data is unspecified
|
||
|
</p>
|
||
|
<p><code class="code"><a class="ref" href="Strings.html#ecl_005falloc_005fadjustable_005fbase_005fstring">ecl_alloc_adjustable_base_string</a></code> is similar to the previous function, but creates an adjustable string with a fill pointer. This means that the length of the string can be changed and the string itself can be resized to accommodate more data.
|
||
|
</p>
|
||
|
<p>The other constructors create strings but use some preexisting data. <code class="code"><a class="ref" href="Strings.html#ecl_005fmake_005fsimple_005fbase_005fstring">ecl_make_simple_base_string</a></code> creates a string copying the data that the user supplies, and using freshly allocated memory. <code class="code"><a class="ref" href="Strings.html#ecl_005fmake_005fconstant_005fbase_005fstring">ecl_make_constant_base_string</a></code> on the other hand, does not allocate memory, but simply uses the supplied pointer as buffer for the string. This last function should be used with care, ensuring that the supplied buffer is not deallocated. If the <var class="var">length</var> argument of these functions is -1, the length is determined by <code class="code">strlen</code>.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
</div>
|
||
|
<div class="subsubsection-level-extent" id="String-accessors">
|
||
|
<h4 class="subsubsection">2.14.2.2 String accessors</h4>
|
||
|
<a class="anchor" id="ecl_005fchar"></a><a class="index-entry-id" id="index-ecl_005fchar"></a>
|
||
|
<a class="anchor" id="ecl_005fchar_005fset"></a><a class="index-entry-id" id="index-ecl_005fchar_005fset"></a>
|
||
|
<p>Reading and writing characters into a string
|
||
|
</p>
|
||
|
<h4 class="subsubheading" id="Functions-12">Functions</h4>
|
||
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
||
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fchar-1"><span class="category-def">Function: </span><span><code class="def-type">ecl_character</code> <strong class="def-name">ecl_char</strong> <code class="def-code-arguments">(cl_object string, cl_index index);</code><a class="copiable-link" href='Strings.html#index-ecl_005fchar-1'> ¶</a></span></dt>
|
||
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fchar_005fset-1"><span class="category-def">Function: </span><span><code class="def-type">ecl_character</code> <strong class="def-name">ecl_char_set</strong> <code class="def-code-arguments">(cl_object string, cl_index index, ecl_character c);</code><a class="copiable-link" href='Strings.html#index-ecl_005fchar_005fset-1'> ¶</a></span></dt>
|
||
|
<dd>
|
||
|
|
||
|
<p><b class="b">Description</b>
|
||
|
</p>
|
||
|
<p>Access to string information should be done using these two functions. The first one implements the equivalent of the <code class="code">char</code> function from Common Lisp, returning the character that is at position <var class="var">index</var> in the string <var class="var">string</var>.
|
||
|
</p>
|
||
|
<p>The counterpart of the previous function is <code class="code"><a class="ref" href="Strings.html#ecl_005fchar_005fset">ecl_char_set</a></code>, which implements <code class="code">(setf char)</code> and stores character <var class="var">c</var> at the position <var class="var">index</var> in the given string.
|
||
|
</p>
|
||
|
<p>Both functions check the type of their arguments and verify that the indices do not exceed the string boundaries. Otherwise they signal a <code class="code">serious-condition</code>.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
</div>
|
||
|
<div class="subsubsection-level-extent" id="Converting-Unicode-strings">
|
||
|
<h4 class="subsubsection">2.14.2.3 Converting Unicode strings</h4>
|
||
|
<p>Converting between different encodings. See <a class="ref" href="Streams.html#Streams-_002d-External-formats">External formats</a> for a list of supported encodings (external formats).
|
||
|
</p>
|
||
|
<h4 class="subsubheading" id="Functions-13">Functions</h4>
|
||
|
<a class="anchor" id="si_005foctets_005fto_005fstring"></a><a class="index-entry-id" id="index-si_005foctets_005fto_005fstring"></a>
|
||
|
<a class="anchor" id="ext_003aoctets_002dto_002dstring"></a><a class="index-entry-id" id="index-ext_003aoctets_002dto_002dstring-1"></a>
|
||
|
<dl class="first-deffn first-defun-alias-first-deffn">
|
||
|
<dt class="deffn defun-alias-deffn" id="index-ext_003aoctets_002dto_002dstring"><span class="category-def">Function: </span><span><strong class="def-name">ext:octets-to-string</strong> <var class="def-var-arguments">octets &key (external-format :default) (start 0) (end nil)</var><a class="copiable-link" href='Strings.html#index-ext_003aoctets_002dto_002dstring'> ¶</a></span></dt>
|
||
|
<dd><p>Decode a sequence of octets (i.e. 8-bit bytes) into a string according
|
||
|
to the given external format. <var class="var">octets</var> must be a vector whose
|
||
|
elements have a size of 8-bit. The bounding index designators
|
||
|
<var class="var">start</var> and <var class="var">end</var> optionally denote a subsequence to be decoded.
|
||
|
Signals an <code class="code"><a class="ref" href="Streams.html#ext_003acharacter_002ddecoding_002derror">ext:character-decoding-error</a></code> if the decoding fails.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
<a class="anchor" id="si_005fstring_005fto_005foctets"></a><a class="index-entry-id" id="index-si_005fstring_005fto_005foctets"></a>
|
||
|
<a class="anchor" id="ext_003astring_002dto_002doctets"></a><a class="index-entry-id" id="index-ext_003astring_002dto_002doctets-1"></a>
|
||
|
<dl class="first-deffn first-defun-alias-first-deffn">
|
||
|
<dt class="deffn defun-alias-deffn" id="index-ext_003astring_002dto_002doctets"><span class="category-def">Function: </span><span><strong class="def-name">ext:string-to-octets</strong> <var class="def-var-arguments">string &key (external-format :default) (start 0) (end nil) (null-terminate nil)</var><a class="copiable-link" href='Strings.html#index-ext_003astring_002dto_002doctets'> ¶</a></span></dt>
|
||
|
<dd><p>Encode a string into a sequence of octets according to the given
|
||
|
external format. The bounding index designators <var class="var">start</var> and
|
||
|
<var class="var">end</var> optionally denote a subsequence to be encoded. If
|
||
|
<var class="var">null-terminate</var> is true, add a terminating null byte. Signals an
|
||
|
<code class="code"><a class="ref" href="Streams.html#ext_003acharacter_002dencoding_002derror">ext:character-encoding-error</a></code> if the encoding fails.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
<a class="anchor" id="ecl_005fdecode_005ffrom_005fcstring"></a><a class="index-entry-id" id="index-ecl_005fdecode_005ffrom_005fcstring"></a>
|
||
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
||
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fdecode_005ffrom_005fcstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_decode_from_cstring</strong> <code class="def-code-arguments">(const char *string, cl_fixnum length, cl_object external_format)</code><a class="copiable-link" href='Strings.html#index-ecl_005fdecode_005ffrom_005fcstring-1'> ¶</a></span></dt>
|
||
|
<dd><p>Decode a C string of the given length into a Lisp string using the
|
||
|
specified external format. If <var class="var">length</var> is -1, the length is
|
||
|
determined by <code class="code">strlen</code>. Returns <code class="code">NULL</code> if the decoding fails.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
<a class="anchor" id="ecl_005fencode_005fto_005fcstring"></a><a class="index-entry-id" id="index-ecl_005fencode_005fto_005fcstring"></a>
|
||
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
||
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fencode_005fto_005fcstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_fixnum</code> <strong class="def-name">ecl_encode_to_cstring</strong> <code class="def-code-arguments">(char *output, cl_fixnum output_length, cl_object input, cl_object external_format)</code><a class="copiable-link" href='Strings.html#index-ecl_005fencode_005fto_005fcstring-1'> ¶</a></span></dt>
|
||
|
<dd><p>Encode the Lisp string <var class="var">input</var> into a C string of the given length
|
||
|
using the specified external format. Returns the number of characters
|
||
|
necessary to encode the Lisp string (including the null terminator). If
|
||
|
this is larger than <var class="var">output_length</var>, <var class="var">output</var> is unchanged.
|
||
|
Returns -1 if the encoding fails.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
<a class="anchor" id="ecl_005fdecode_005ffrom_005funicode_005fwstring"></a><a class="index-entry-id" id="index-ecl_005fdecode_005ffrom_005funicode_005fwstring"></a>
|
||
|
<a class="anchor" id="ecl_005fencode_005fto_005funicode_005fwstring"></a><a class="index-entry-id" id="index-ecl_005fencode_005fto_005funicode_005fwstring"></a>
|
||
|
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
|
||
|
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-ecl_005fdecode_005ffrom_005funicode_005fwstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_object</code> <strong class="def-name">ecl_decode_from_unicode_wstring</strong> <code class="def-code-arguments">(const wchar_t *string, cl_fixnum length)</code><a class="copiable-link" href='Strings.html#index-ecl_005fdecode_005ffrom_005funicode_005fwstring-1'> ¶</a></span></dt>
|
||
|
<dt class="deftypefnx deftypefunx-alias-deftypefnx def-cmd-deftypefn" id="index-ecl_005fencode_005fto_005funicode_005fwstring-1"><span class="category-def">Function: </span><span><code class="def-type">cl_fixnum</code> <strong class="def-name">ecl_encode_to_unicode_wstring</strong> <code class="def-code-arguments">(wchar_t *output, cl_fixnum output_length, cl_object input)</code><a class="copiable-link" href='Strings.html#index-ecl_005fencode_005fto_005funicode_005fwstring-1'> ¶</a></span></dt>
|
||
|
<dd><p>These functions work the same as <code class="code"><a class="ref" href="Strings.html#ecl_005fdecode_005ffrom_005fcstring">ecl_decode_from_cstring</a></code>,
|
||
|
<code class="code"><a class="ref" href="Strings.html#ecl_005fencode_005fto_005fcstring">ecl_encode_to_cstring</a></code>, except that the external format used is
|
||
|
either utf-8, utf-16 or utf-32 depending on whether
|
||
|
<code class="code">sizeof(wchar_t)</code> is 1, 2, or 4 respectively.
|
||
|
</p></dd></dl>
|
||
|
|
||
|
</div>
|
||
|
<div class="subsubsection-level-extent" id="ANSI-dictionary-2">
|
||
|
<h4 class="subsubsection">2.14.2.4 ANSI dictionary</h4>
|
||
|
<p>Common Lisp and C equivalence
|
||
|
</p>
|
||
|
<table class="multitable">
|
||
|
<thead><tr><th width="22%">Lisp symbol</th><th width="78%">C function</th></tr></thead>
|
||
|
<tbody><tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_smp-st.htm">simple-string-p</a></td><td width="78%">cl_object cl_simple_string_p(cl_object string)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_char_.htm">char</a></td><td width="78%">cl_object cl_char(cl_object string, cl_object index)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_char_.htm">(setf char)</a></td><td width="78%">cl_object si_char_set(cl_object string, cl_object index, cl_object char)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_char_.htm">schar</a></td><td width="78%">cl_object cl_schar(cl_object string, cl_object index)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_char_.htm">(setf schar)</a></td><td width="78%">cl_object si_char_set(cl_object string, cl_object index, cl_object char)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_string.htm">string</a></td><td width="78%">cl_object cl_string(cl_object x)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">string-upcase</a></td><td width="78%">cl_object cl_string_upcase(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">string-downcase</a></td><td width="78%">cl_object cl_string_downcase(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">string-capitalize</a></td><td width="78%">cl_object cl_string_capitalize(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">nstring-upcase</a></td><td width="78%">cl_object cl_nstring_upcase(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">nstring-downcase</a></td><td width="78%">cl_object cl_nstring_downcase(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_up.htm">nstring-capitalize</a></td><td width="78%">cl_object cl_nstring_capitalize(cl_narg narg, cl_obejct string, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_tr.htm">string-trim</a></td><td width="78%">cl_object cl_string_trim(cl_object character_bag, cl_object string)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_tr.htm">string-left-trim</a></td><td width="78%">cl_object cl_string_left_trim(cl_object character_bag, cl_object string)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stg_tr.htm">string-right-trim</a></td><td width="78%">cl_object cl_string_right_trim(cl_object character_bag, cl_object string)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_string.htm">string</a></td><td width="78%">cl_object cl_string(cl_object x)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string=</a></td><td width="78%">cl_object cl_stringE(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string/=</a></td><td width="78%">cl_object cl_stringNE(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string<</a></td><td width="78%">cl_object cl_stringL(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string></a></td><td width="78%">cl_object cl_stringG(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string<=</a></td><td width="78%">cl_object cl_stringLE(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string>=</a></td><td width="78%">cl_object cl_stringGE(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-equal</a></td><td width="78%">cl_object cl_string_equal(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-not-equal</a></td><td width="78%">cl_object cl_string_not_equal(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-lessp</a></td><td width="78%">cl_object cl_string_lessp(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-greaterp</a></td><td width="78%">cl_object cl_string_greaterp(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-not-greaterp</a></td><td width="78%">cl_object cl_string_not_greaterp(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgeq_.htm">string-not-lessp</a></td><td width="78%">cl_object cl_string_not_lessp(cl_narg narg, cl_object string1, cl_object string2, ...)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_stgp.htm">stringp</a></td><td width="78%">cl_object cl_stringp(cl_object x)</td></tr>
|
||
|
<tr><td width="22%"><a class="url" href="http://www.lispworks.com/documentation/HyperSpec/Body/f_mk_stg.htm">make-string</a></td><td width="78%">cl_object cl_make_string(cl_narg narg, cl_object size, ...)</td></tr>
|
||
|
</tbody>
|
||
|
</table>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr>
|
||
|
<div class="nav-panel">
|
||
|
<p>
|
||
|
Next: <a href="Sequences.html" accesskey="n" rel="next">Sequences</a>, Previous: <a href="Arrays.html#Arrays" accesskey="p" rel="prev">Arrays</a>, Up: <a href="Standards.html" accesskey="u" rel="up">Standards</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Indexes.html" title="Index" rel="index">Index</a>]</p>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
|
||
|
</body>
|
||
|
</html>
|