From:             [EMAIL PROTECTED]
Operating system: Linux red hat 6.2 Kernel 2.2.17
PHP version:      4.0.2
PHP Bug Type:     OCI8 related
Bug description:  impossible to write and read thai language in an oracle database

I actually front to a major problem using PHP (4.0.2) to insert Thai characters into 
an Oracle 

database. The mail is a little bit long but try to explain many things.

I am using Oracle under Linux RH 6.2 Kernel 2.2.17 recompiled for oracle and Apache 
A lot of people seems to have the same problem (when they want to insert arabic or 

characters) using the same configuration (cf. PHP sites mailing lists / forum).

The problem doesn't seems to be a configuration problem. Oracle is correctly 
configured (I mean 

Thai character set -as oracle told me- and env. variables...) and insertion rules are 
conform to 

Oracle doc. However, all tests have been also made with the UTF-8 character set.

Regarding the tests I have done and information I have gotten from various 
programmers, Oracle 

can definitely store Thai.
Php can display web pages with Thai language (the basic test is to input Thai from a 
html form 

and generate a new web page with what has been input before).

BUT, there is one thing that I don't completly understand:
*) When I sniff the incoming and outgoing information going through the linux 
oracle+web server, 

I can see that the incoming information (posted from a browser) is:
'S Q L = & T H A I = % E 6 % E 4 % D 3 % B E % D 0 % D 1 % D 5 & S u b = S u b m i t'
So this is Hexa. representing ascii code greather than 128 (equiv to 230,228,211... in 

which is Thai characters.

*)If I ask Php to generate a new page with the Thai sentence I have input before, php 
send back 

' b r > . s q l :     I N S E R T   I N T O   S C O T T . T H A I 2   ( C O L )   V A 
L U E S ( N 

' . . . . . . . ' ) < b r > . s t a t e m e n t   e x e c u t e d < b r >'
NOTE: The dot '.' represent ascii decimal code greather than 127. So a conversion has 
been done 

within php but it works.

*) What is stored in the database is the received ASCII code (230,228,211...) LESS 128 

(102,100,83..). So in oracle, I have a non thai sentence.

The main question is:
Which entity modify the ascii code? Php? Oracle? Apache? all of them will receive this 

Of course, a solution is to add 128 when you retrieve characters from the database but 

it's dirty and second, thai sentence can contain numbers ;-)...

I really hope someone can help.
I thank you all in advance,

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to