#10326 [Opn->Bgs]: Error while inserting cyrillic symbols into database
| From: | kalowsky@php.net | Date: | Wed, 14 Aug 2002 03:03:55 +0000 |
| Subject: | #10326 [Opn->Bgs]: Error while inserting cyrillic symbols into database | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-16704@lists.php.net to get a copy of this message | ||
ID: 10326
Updated by: kalowsky@php.net
Reported By: flying@dom.natm.ru
-Status: Open
+Status: Bogus
Bug Type: InterBase related
Operating System: Windows NT4 SP6
PHP Version: 4.0.4
New Comment:
Sorry, but the bug system is not the appropriate forum for asking
support questions. Your problem does not imply a bug in PHP itself.
For a list of more appropriate places to ask for help using PHP,
please visit http://www.php.net/support.php
Thank you for your interest in PHP.
As per other user comment
Previous Comments:
------------------------------------------------------------------------
[2002-03-15 16:53:05] mikep@kaluga.org
try to specify the codepage in ibase_connect:
ibase_connect($dbase,$usr,$pswd,'WIN1251')
or other you like...
it worked fine for me....
------------------------------------------------------------------------
[2001-04-14 10:46:10] flying@dom.natm.ru
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