Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 4fccfe23f6486142b4197d1daac0cf21 > files > 65

Falcon-doc-0.9.6.6-2.fc15.noarch.rpm

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <title>Function set "Transcoding functions" - Function set "Transcoding functions"</title>
   <link href="faldoc.css" rel="stylesheet" type="text/css"/>
   <link href="tabs.css" rel="stylesheet" type="text/css"/>
</head>
<body class="faldoc_body">
<div class="navitop">
   <div class="tabs">
      <ul>
         <li><a href="./index.html"><span>Main</span></a></li>
         <li><a href="./pages.html"><span>Related pages</span></a></li>
         <li><a href="./groups.html"><span>Groups</span></a></li>
         <li><a href="./funset.html"><span>Function sets</span></a></li>
         <li><a href="./classes.html"><span>Classes</span></a></li>
         <li><a href="./objects.html"><span>Objects</span></a></li>
         <li><a href="./functions.html"><span>All functions</span></a></li>
         <li><a href="./globals.html"><span>Globals</span></a></li>
         
      </ul>
   </div>
</div>
<hr/>

<h1 class="faldoc_title">Function set "Transcoding functions"</h1>

<p class="faldoc_brief">Functions needed to transcode texts into various character sets. </p>



   <p class="faldoc_brief"><a href="#more">more...</a></p>
   <h2 class="faldoc_title">Summary</h2>
   <table class="faldoc_list">
   
      
         <tr><td><a href="#getSystemEncoding">getSystemEncoding()</a></td><td>Returns the "official" system encoding, if it matches with one known by Falcon. </td></tr>
      
         <tr><td><a href="#transcodeFrom">transcodeFrom()</a></td><td>Returns a Falcon string created by parsing the given one as a binary sequence of bytes. </td></tr>
      
         <tr><td><a href="#transcodeTo">transcodeTo()</a></td><td>Returns a binary buffer containing an encoded representation of a Falcon string. </td></tr>
      
   
   </table>







<a name="more"><h2 class="faldoc_title">Detailed description</h2></a>


<table class="faldoc_function">


</table>
<br/>
<p class="item_brief">Functions needed to transcode texts into various character sets. </p>
<p class="faldoc_text">Transcoding functions turns binary strings encoded in a format into Falcon strings, or conversely, they turn Falcon strings into binary encoded buffers. Used in combination with binary stream reads and write, this function allows full internationalization of script input and output. </p>
<p class="faldoc_text"> However, if the target stream is known to support safe reads and writes and to provide immediate access to the needed data, the <a href="./class_Stream.html#setEncoding">Stream.setEncoding</a> method is more efficient, as it doesn't need a temporary buffer to store the binary read data, or the binary data that has to be written. </p>




   <h2 class="faldoc_title">Members</h2>
   
      <h3 class="faldoc_funcname"><a name="getSystemEncoding">getSystemEncoding()</a></h3>
      <p class="item_brief">Returns the "official" system encoding, if it matches with one known by Falcon. </p>
      <p class="faldoc_funcdecl">getSystemEncoding</p>
      
         <table class="faldoc_function">
         
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">The system encoding name. </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">This function will return the name under which Falcon knows the default system encoding. Using returned value, the program is able to create encoders that should be able to parse the data provided by system functions as directory scanning, or that is probably used as the main encoding for system related text files (i.e. configuration files). </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="transcodeFrom">transcodeFrom()</a></h3>
      <p class="item_brief">Returns a Falcon string created by parsing the given one as a binary sequence of bytes. </p>
      <p class="faldoc_funcdecl">transcodeFrom( string, encoding )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">string</td><td class="faldoc_paramdesc">Falcon string or MemBuf to be encoded. </td></tr><tr><td class="faldoc_param">encoding</td><td class="faldoc_paramdesc">Name of the encoding (as a string). </td></tr>
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">On success, the transcoded string. </td></tr>
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_ParamError.html">ParamError</a></td><td class="faldoc_raisedesc">if the encoding is not known. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">In case the encoding name is not known, the function will raise a ParamError. The transcoding may also fail if the source data is not a valid sequence under the given encoding, and cannot be decoded. </p>
</p>
   
      <h3 class="faldoc_funcname"><a name="transcodeTo">transcodeTo()</a></h3>
      <p class="item_brief">Returns a binary buffer containing an encoded representation of a Falcon string. </p>
      <p class="faldoc_funcdecl">transcodeTo( string, encoding )</p>
      
         <table class="faldoc_function">
         <tr><td class="faldoc_param">string</td><td class="faldoc_paramdesc">Falcon string to be encoded. </td></tr><tr><td class="faldoc_param">encoding</td><td class="faldoc_paramdesc">Name of the encoding (as a string). </td></tr>
         
         <tr><td class="faldoc_funcreturn">Returns:</td><td class="faldoc_funcreturndesc">On success, the transcoded string. </td></tr>
         
            <tr><td class="faldoc_raise">Raises:</td><td class="faldoc_raisedesc">
            <table class="faldoc_raise">
            <tr><td class="faldoc_raiseitem"><a href="./class_ParamError.html">ParamError</a></td><td class="faldoc_raisedesc">if the encoding is not known. </td></tr>
            </table>
            </td></tr>
         
         </table>
      
      <p class="faldoc_text"><p class="faldoc_text">In case the encoding name is not known, the function will raise a ParamError. </p>
</p>
   

<hr/>
<div class="navibottom">
   <center>
      <a href="./index.html">Main</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./pages.html">Related pages</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./groups.html">Groups</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./funset.html">Function sets</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./classes.html">Classes</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./objects.html">Objects</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./functions.html">All functions</a>&nbsp;&nbsp;-&nbsp;&nbsp;<a href="./globals.html">Globals</a>
   </center>
</div>
</div>
<div class="faldoc_signature">Made with <a href="http://www.falconpl.org">faldoc 2.2.0</div>
</body>
</html>