php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8630 impossible to write and read thai language in an oracle database
Submitted: 2001-01-10 07:05 UTC Modified: 2001-03-09 21:16 UTC
From: stephane at asiatdc dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0.2 OS: Linux red hat 6.2 Kernel 2.2.17
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: stephane at asiatdc dot com
New email:
PHP Version: OS:

 

 [2001-01-10 07:05 UTC] stephane at asiatdc dot com
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 1.3.12.
A lot of people seems to have the same problem (when they want to insert arabic or japanese 

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 decimal) 

which is Thai characters.

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

the ASCII DECIMAL code:
' 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 mail.

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

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

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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-01-11 12:07 UTC] sniper@php.net
Did you setup all the relevant environment variables
before starting Apache?

Check the manual:
http://www.php.net/manual/ref.oci8.php

--Jani 

 [2001-03-09 21:16 UTC] sniper@php.net
No feedback. If problem still exists with latest CVS snapshot and when those environment vars are set, reopen.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC