2003-06-21 13:24:58 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2004-07-27 04:48:55 +00:00
|
|
|
<!-- $Revision: 1.4 $ -->
|
2003-06-21 13:24:58 +00:00
|
|
|
<refentry id="function.sqlite-udf-encode-binary">
|
|
|
|
<refnamediv>
|
|
|
|
<refname>sqlite_udf_encode_binary</refname>
|
2004-07-27 04:48:55 +00:00
|
|
|
<refpurpose>Encode binary data before returning it from an UDF</refpurpose>
|
2003-06-21 13:24:58 +00:00
|
|
|
</refnamediv>
|
|
|
|
<refsect1>
|
|
|
|
<title>Description</title>
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>sqlite_udf_encode_binary</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
<function>sqlite_udf_encode_binary</function> applies a binary encoding
|
|
|
|
to the <parameter>data</parameter> so that it can be safely returned from
|
|
|
|
queries (since the underlying libsqlite API is not binary safe).
|
|
|
|
</para>
|
|
|
|
<para>
|
2003-12-19 15:50:07 +00:00
|
|
|
If there is a chance that your data might be binary unsafe (e.g.: it
|
2003-06-21 13:24:58 +00:00
|
|
|
contains a NUL byte in the middle rather than at the end, or if it has and
|
|
|
|
<literal>0x01</literal> byte as the first character) then you must
|
|
|
|
call this function to encode the return value from your UDF.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
PHP does not perform this encode/decode operation automatically as it would
|
|
|
|
severely impact performance if it did.
|
|
|
|
</para>
|
|
|
|
<note>
|
|
|
|
<para>
|
2003-07-06 04:43:08 +00:00
|
|
|
Do not use <function>sqlite_escape_string</function> to quote strings
|
|
|
|
returned from UDF's as it will lead to double-quoting of the data. Use
|
|
|
|
<function>sqlite_udf_encode_binary</function> instead!
|
2003-06-21 13:24:58 +00:00
|
|
|
</para>
|
|
|
|
</note>
|
|
|
|
<para>
|
|
|
|
See also <function>sqlite_udf_decode_binary</function>,
|
|
|
|
<function>sqlite_escape_string</function>,
|
|
|
|
<function>sqlite_create_function</function> and
|
|
|
|
<function>sqlite_create_aggregate</function>.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|