]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
Reformat code
[SourceForge/phpwiki.git] / lib / WikiDB / adodb / drivers / adodb-odbtp_unicode.inc.php
1 <?php
2 /*
3 V4.22 15 Apr 2004  (c) 2000-2004 John Lim (jlim@natsoft.com.my). All rights reserved.
4   Released under both BSD license and Lesser GPL library license.
5   Whenever there is any discrepancy between the two licenses,
6   the BSD license will take precedence. See License.txt.
7   Set tabs to 4 for best viewing.
8   Latest version is available at http://php.weblogs.com/
9 */
10
11 // Code contributed by "Robert Twitty" <rtwitty#neutron.ushmm.org>
12
13 /*
14     Because the ODBTP server sends and reads UNICODE text data using UTF-8
15     encoding, the following HTML meta tag must be included within the HTML
16     head section of every HTML form and script page:
17
18     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
19
20     Also, all SQL query strings must be submitted as UTF-8 encoded text.
21 */
22
23 if (!defined('_ADODB_ODBTP_LAYER')) {
24     include(ADODB_DIR . "/drivers/adodb-odbtp.inc.php");
25 }
26
27 class ADODB_odbtp_unicode extends ADODB_odbtp
28 {
29     var $databaseType = "odbtp_unicode";
30     var $_useUnicodeSQL = true;
31
32     function ADODB_odbtp_unicode()
33     {
34         $this->ADODB_odbtp();
35     }
36 }
37
38 class ADORecordSet_odbtp_unicode extends ADORecordSet_odbtp
39 {
40     var $databaseType = 'odbtp_unicode';
41
42     function ADORecordSet_odbtp_unicode($queryID, $mode = false)
43     {
44         $this->ADORecordSet_odbtp($queryID, $mode);
45     }
46
47     function _initrs()
48     {
49         $this->_numOfFields = @odbtp_num_fields($this->_queryID);
50         if (!($this->_numOfRows = @odbtp_num_rows($this->_queryID)))
51             $this->_numOfRows = -1;
52
53         if ($this->connection->odbc_driver == ODB_DRIVER_JET) {
54             for ($f = 0; $f < $this->_numOfFields; $f++) {
55                 if (odbtp_field_bindtype($this->_queryID, $f) == ODB_CHAR)
56                     odbtp_bind_field($this->_queryID, $f, ODB_WCHAR);
57             }
58         }
59     }
60 }