Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 649

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.title" content="Function: uuencode - Virtuoso Functions Guide" />
  <meta name="dc.subject" content="Function: uuencode - Virtuoso Functions Guide" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href="functions.html" title="Chapter Contents" />
  <link rel="prev" href="appendixa.html" title="Appendix" />
  <link rel="next" href="functions.html#.html" title="" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>Function: uuencode - Virtuoso Functions Guide</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="" />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="fn_uuencode" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>22. Virtuoso Functions Guide - uuencode</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="functions.html">Chapter Contents</a> | <a class="link" href="fn_uudecode.html" title="uudecode">Prev</a> | <a class="link" href="functions.html#file" title="File Manipulation">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div>
      <a class="selected" href="functions.html">Virtuoso Functions Guide</a>
   </div>
    <br />
   <div>
      <a href="functions.html#admin">Administration</a>
   </div>
   <div>
      <a href="functions.html#aggr">Aggregate Functions</a>
   </div>
   <div>
      <a href="functions.html#array">Array Manipulation</a>
   </div>
   <div>
      <a href="functions.html#bpel">BPEL APIs</a>
   </div>
   <div>
      <a href="functions.html#backup">Backup</a>
   </div>
   <div>
      <a href="functions.html#compression">Compression</a>
   </div>
   <div>
      <a href="functions.html#cursors">Cursor</a>
   </div>
   <div>
      <a href="functions.html#time">Date &amp; Time Manipulation</a>
   </div>
   <div>
      <a href="functions.html#debug">Debug</a>
   </div>
   <div>
      <a href="functions.html#dict">Dictionary Manipulation</a>
   </div>
   <div>
      <a class="selected" href="functions.html#encoding">Encoding &amp; Decoding</a>
   </div>
   <div class="selected">
    <div>
        <a href="fn_encode_base64.html">encode_base64</a>
    </div>
    <div>
        <a href="fn_split_and_decode.html">split_and_decode</a>
    </div>
    <div>
        <a href="fn_uudecode.html">uudecode</a>
    </div>
    <div>
        <a class="selected" href="fn_uuencode.html">uuencode</a>
    </div>
   </div>
   <div>
      <a href="functions.html#file">File Manipulation</a>
   </div>
   <div>
      <a href="functions.html#ft">Free Text</a>
   </div>
   <div>
      <a href="functions.html#hash">Hashing / Cryptographic</a>
   </div>
   <div>
      <a href="functions.html#ldap">LDAP</a>
   </div>
   <div>
      <a href="functions.html#localization">Locale</a>
   </div>
   <div>
      <a href="functions.html#mail">Mail</a>
   </div>
   <div>
      <a href="functions.html#misc">Miscellaneous</a>
   </div>
   <div>
      <a href="functions.html#number">Number</a>
   </div>
   <div>
      <a href="functions.html#phrz">Phrases</a>
   </div>
   <div>
      <a href="functions.html#rdf">RDF data</a>
   </div>
   <div>
      <a href="functions.html#rmt">Remote SQL Data Source</a>
   </div>
   <div>
      <a href="functions.html#repl">Replication</a>
   </div>
   <div>
      <a href="functions.html#soap">SOAP</a>
   </div>
   <div>
      <a href="functions.html#sql">SQL</a>
   </div>
   <div>
      <a href="functions.html#string">String</a>
   </div>
   <div>
      <a href="functions.html#txn">Transaction</a>
   </div>
   <div>
      <a href="functions.html#type">Type Mapping</a>
   </div>
   <div>
      <a href="functions.html#uddi">UDDI</a>
   </div>
   <div>
      <a href="functions.html#udt">User Defined Types &amp; The CLR</a>
   </div>
   <div>
      <a href="functions.html#vad">VAD</a>
   </div>
   <div>
      <a href="functions.html#jvmpl">Virtuoso Java PL API</a>
   </div>
   <div>
      <a href="functions.html#bif">Virtuoso Server Extension Interface (VSEI)</a>
   </div>
   <div>
      <a href="functions.html#ws">Web &amp; Internet</a>
   </div>
   <div>
      <a href="functions.html#xml">XML</a>
   </div>
   <div>
      <a href="functions.html#XPATH">XPATH &amp; XQUERY</a>
   </div>
    <br />
   <div>
      <a href="functionidx.html">Functions Index</a>
   </div>
    <br />
  </div>
  <div id="text">
    <h2>uuencode</h2>
    <div class="refpurpose">Encodes string or string session into sequence of printable characters, suitable for transfer via &quot;ASCII-only&quot; data channels</div>
    <div class="funcsynopsis">
        <span class="funcdef">
     <span class="function">uuencode</span>
     </span>
	(<span class="paramdef">in <span class="parameter">input</span> string or string session</span>, 
	<span class="paramdef">in <span class="parameter">mode</span> integer</span>, 
	<span class="paramdef">in <span class="parameter">maxlines</span> integer</span>);
      </div>
  
  
  
  <div class="refsect1">
      <div class="refsect1title">Description</div>
    <p>
There are many protocols, like classic UNIX uuencode,
which are used to transmit binary files
over transmission mediums that do not support other than
simple ASCII data. The epoch of physical lines of such sort is
in past but file attachments in most popular mail systems still
follow old regulations.
    </p>
    <p>
Encoded data are transmitted as a sequence of one or more &quot;sections&quot;.
They may be stored or sent as independent documents.
Every section contains some range of original document&#39;s data.
They may be decoded one after another, and original
document may be composed by concatenation of decoded fragments.
If the document is small (or if there&#39;s no limit on the size of message),
it may be sent as single section.
    </p>
    <p>
Every section has some header and footer and a set of
lines with data between them. Headers and especially footers are
usually optional and may vary from system to system whereas
data lines are described by standards. Data lines of any two
consequent sections may be concatenated together, if needed, to
create longer section.
    </p>
    <p>
<span class="computeroutput">uuencode</span> creates a vector of strings, where
every string contains some number of data lines, without headers or
footers. A Virtuoso/PL stored procedure may be used to create some output
stream(s) and put there sections of appropriate format with
data lines from vector.
Every item of the created vector will contain up to
<span class="computeroutput">maxlines</span> lines of data,
usually 60 to 80 bytes per line; <span class="computeroutput">maxlines</span>
may vary from 10 to 120000 so section may be 0.8Kb to 10Mb long
depending on your choice.
Last section may be shorter than other, if only partially filled.
10Mb limit may be bypassed by sending of sections one after another
without intermediate footers or headers, but please keep in
mind that you cannot concatenate two strings in memory if
the sum of their lengths exceeds system-wide 10Mb.
    </p>
    <p>
RFC 2045,
(N. Borenstein, N. Freed.
MIME (Multipurpose Internet Mail Extensions) Part One:
The Format of Internet Message Bodies),
contains detailed description of most important encodings used by mail
systems.
Older RFC 1521 is now obsoleted.
    </p>
    <p>
Currently, eight conventions are used for mail attachments.
In Virtuoso, they are enumerated by integer IDs.
    </p>
    <table class="data">
      
       <tr>
          <th class="data">ID</th>
          <th class="data">Standard</th>
          <th class="data">Description</th>
        </tr>
	
	  <tr>
	    <td class="data">1</td>
          <td class="data">&quot;Native&quot; UUencode</td>
	    <td class="data">
Optional header is one line started by &quot;begin &quot; or &quot;&lt;pre&gt;begin &quot; keyword, with some system-specific data after it.
Optional footer is one line started by &quot;end&quot; keyword.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">2</td>
          <td class="data">Base-64, UNIX version</td>
	    <td class="data">
There are no agreements about headers or footers.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">3</td>
          <td class="data">Base-64, MIME version</td>
	    <td class="data">
This standard is very similar to &quot;Base-64, UNIX version&quot;.
Virtuoso, like all modern mail clients,
feel no difference between them when decode sections, because
the only difference is in the number of data bytes per line.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">4</td>
          <td class="data">XXencode</td>
	    <td class="data">
This standard is an obsolete standard, similar to Unicode,
but not compatible.
There are no agreements about headers or footers.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">5</td>
          <td class="data">BinHex</td>
	    <td class="data">
There are no header or footer lines, but first line of every
section should be prefixed by colon (&#39;:&#39;) character.
Application should place colon before data lines of every section.
(this function will prepare only data lines without this prefix).
	    </td>
	  </tr>
	  <tr>
	    <td class="data">6-9</td>
          <td class="data">reserved</td>
	    <td class="data">
More standards may be used in the future. It is unsafe to
assume that all existing standards are listed here.
Real application will often receive messages with unknown or
misspelled encodings&#39; names, syntax errors in data etc.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">10</td>
          <td class="data">MIME Plain-Text</td>
	    <td class="data">
This &quot;encoding&quot; is suitable only for texts.
They are stored &quot;as is&quot;, but line ends will not be preserved.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">11</td>
          <td class="data">MIME Quoted-Printable (for texts)</td>
	    <td class="data">
This encoding is suitable for any sort of textual data,
because ASCII printable characters are stored
&quot;as is&quot; and only nonprintable characters are encoded.
UNIX linefeeds (LF chars) will be encoded as &quot;hard breaks&quot;, so decoding
side may convert them into its own system-specific &quot;line end&quot; chars, e.g.
in CRLF sequence.
	    </td>
	  </tr>
	  <tr>
	    <td class="data">12</td>
          <td class="data">MIME Quoted-Printable (for binaries)</td>
	    <td class="data">
This encoding is suitable for any sort of data but it is especially
useful for textual data, because ASCII printable characters are stored
&quot;as is&quot; and only nonprintable characters are encoded.
No &quot;hard breaks&quot; will be used for UNIX linefeeds (LF chars) of source file,
so the file will be decoded exactly as it was encoded, no matter which
character sequence is used for &quot;line end&quot; in the decoder&#39;s OS.
When in trouble, whether the data encoded are text or binary, use
this variant (&quot;for binaries&quot;): text may be easily recovered by recipient
if linefeeds are wrong whereas binary data will become unusable if encoded as text.
	    </td>
	  </tr>
	
      
    </table>
      <br />
  </div>
  <div class="refsect1">
      <div class="refsect1title">Parameters</div>
    <div class="refsect2">
        <span class="refsect2title">input – </span>
      String or string-output session with data to be encoded.</div>
    <div class="refsect2">
        <span class="refsect2title">mode – </span>
      Integer ID of encoding to be used.</div>
    <div class="refsect2">
        <span class="refsect2title">maxlines – </span>
      Number of data lines per section. Should be in range 10 to 120000,
otherwise nearest suitable value will be used without reporting any error.</div>
  </div>
  <div class="refsect1">
      <div class="refsect1title">Return Types</div>
      <p>
Vector of strings, where every string contains all data lines of a section.
</p>
    </div>
  <div class="refsect1title">Errors</div>
    <table class="data">
      
       <tr>
        <th class="data">SQLState</th>
        <th class="data">Error Code</th>
        <th class="data">Error Text</th>
        <th class="data">Description</th>
      </tr>
	
	  <tr>
	    <td class="data">
          <a name="err22023" />
          <span class="errorcode">22023</span>
        </td>
	    <td class="data">
          <a name="errUUE01" />
          <span class="errorcode">UUE01</span>
        </td>
	    <td class="data">
          <span class="errorname">Function uuencode needs a string output or a string as argument 1, not an arg of type ... (...)</span>
        </td>
	    <td class="data" />
	  </tr>
	  <tr>
	    <td class="data">
          <a name="err22023" />
          <span class="errorcode">22023</span>
        </td>
	    <td class="data">
          <a name="errUUE02" />
          <span class="errorcode">UUE02</span>
        </td>
	    <td class="data">
          <span class="errorname">Unsupported type of UU-encoding (...)</span>
        </td>
	    <td class="data" />
	  </tr>
	
      
    </table>
    <br />
  <p />
  <div class="refsect1">
      <div class="refsect1title">Examples</div>
    <a name="ex_uuencode" />
      <div class="example">
        <div class="exampletitle">BinHex</div>
      <p>This function displays BinHex result of uuencode as a result-set of sections.</p>
      <div>
          <pre class="screen">
-- Line 4:
create procedure BINHEX_ENCODE (in txt varchar, in lines_per_section integer)
{
  declare SECTION varchar;
  declare sections any;
  result_names (SECTION);
  sections := uuencode (txt, 5, lines_per_section);
  foreach (varchar sect in sections) do
    result (&#39;:&#39; || sect);
}


Done. -- 00000 msec.

BINHEX_ENCODE (&#39;Hello&#39;, 10)
SECTION
VARCHAR
_______________________________________________________________________________

:5&#39;9XE&#39;m:


1 Rows. -- 00000 msec.

BINHEX_ENCODE (repeat (&#39;Hello&#39;, 100), 10)
SECTION
VARCHAR
_______________________________________________________________________________

:5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[

:5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[5&#39;9XE&#39;p)C@aXEdKPE&#39;a[
5&#39;9XE&#39;m:


2 Rows. -- 00000 msec.</pre>
        </div>
    </div>
  </div>
  <div class="refsect1">
      <div class="refsect1title">See Also</div>
    <p>
      <a href="fn_uudecode.html">uudecode</a>,
      <a href="fn_uudecode.html">uuvalidate</a>
    </p>
  </div>
</div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>