ID:               10326
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Open
 Bug Type:         InterBase related
 Operating System: Windows NT4 SP6
 PHP Version:      4.0.4
 New Comment:

try to specify the codepage in ibase_connect:
ibase_connect($dbase,$usr,$pswd,'WIN1251')
or other you like...
it worked fine for me....


Previous Comments:
------------------------------------------------------------------------

[2001-04-14 10:46:10] [EMAIL PROTECTED]

Environment:
  Windows NT 4.0 SP6
  PHP v4.0.4 (binaries from www.php.net)
  InterBase v6.0.0.627
  Apache v1.3.17

 The following is metadata for simple InterBase database and short
script that tries to insert a range of symbols into this database.
 All works ok while inserting symbols with codes lower than 128, but
for all symbols with codes greater than 128 (included cyrillic symbols
in windows-1251 code page with codes in range 192..255) the following
error is received:

Warning: InterBase: arithmetic exception, numeric overflow, or string
truncation Cannot transliterate character between character sets in
d:\web\dom\test\qqq.php on line 7

 Note, that nothing is actually inserted into database. Executing the
same query directly into InterBase causes data to be inserted properly

Database metadata:
==================
SET SQL DIALECT 3;

SET NAMES WIN1251;

CREATE DATABASE 'D:\db\base.gdb' USER 'user' PASSWORD 'password'
PAGE_SIZE 4096
DEFAULT CHARACTER SET WIN1251;

CREATE GENERATOR GEN_TEST_ID;
SET GENERATOR GEN_TEST_ID TO 0;

CREATE TABLE TEST (
    ID INTEGER NOT NULL,
    TEXT VARCHAR(100));


SET TERM ^ ;

CREATE TRIGGER TEST_BI FOR TEST
ACTIVE BEFORE INSERT POSITION 0
AS
BEGIN
  IF (NEW.ID IS NULL) THEN
    NEW.ID = GEN_ID(GEN_TEST_ID,1);
END
^

SET TERM ; ^

Test PHP script to reproduce bug:
=================================
<?php
    $ib = ibase_connect("d:\\db\\base.gdb" , "user", "password");
    for ($i=60;$i<256;$i++)
    {
        $sql = "INSERT INTO TEST (TEXT) VALUES ('".chr($i)."');";
        echo $sql."<br>";
        $query = ibase_query($ib,$sql);
    };
    ibase_close($ib);
?>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=10326&edit=1

Reply via email to