]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - lib/WikiDB/adodb/drivers/adodb-odbtp_unicode.inc.php
remove final \n to be ob_cache independent
[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         var $databaseType = "odbtp_unicode";
29         var $_useUnicodeSQL = true;
30
31         function ADODB_odbtp_unicode()
32         {
33                 $this->ADODB_odbtp();
34         }
35 }
36
37 class ADORecordSet_odbtp_unicode extends ADORecordSet_odbtp {
38         var $databaseType = 'odbtp_unicode';
39
40         function ADORecordSet_odbtp_unicode($queryID,$mode=false)
41         {
42                 $this->ADORecordSet_odbtp($queryID, $mode);
43         }
44
45         function _initrs()
46         {
47                 $this->_numOfFields = @odbtp_num_fields($this->_queryID);
48                 if (!($this->_numOfRows = @odbtp_num_rows($this->_queryID)))
49                         $this->_numOfRows = -1;
50
51                 if ($this->connection->odbc_driver == ODB_DRIVER_JET) {
52                         for ($f = 0; $f < $this->_numOfFields; $f++) {
53                                 if (odbtp_field_bindtype($this->_queryID, $f) == ODB_CHAR)
54                                         odbtp_bind_field($this->_queryID, $f, ODB_WCHAR);
55                         }
56                 }
57         }
58 }
59 ?>