Oracle and PHP - insert special characters problem

I have computer with these software:
Fedora Core 4
Apache 2.0.54
PHP 5.0.4
Oracle 10.2.0
Firefox (character set: UTF8)
System environment:
[oracle@computer /] echo $ORACLE_HOME
/db/u01/app/oracle/product/10.2.0/db_1
[oracle@computer /] echo $NLS_LANG
SLOVENIAN_SLOVENIA.AL32UTF8
I get this for every user, because I have in /etc/profiles:
NLS_LANG=SLOVENIAN_SLOVENIA.AL32UTF8; export NLS_LANG;
ORACLE_HOME=/db/u01/app/oracle/product/10.2.0/db_1; export ORACLE_HOME;
Oracle NLS parameters:
SQL> SELECT NLS_LANGUAGE, NLS_TERRITORY, NLS_CHARACTERSET FROM NLS_DATABASE_PARAMETERS;
SLOVENIAN, SLOVENIA, AL32UTF8
And similar for NLS_INSTANCE_PARAMETERS and NLS_SESSION_PARAMETERS.
phpinfo() returns:
Apache Environment
Variable     Value
NLS_LANG      SLOVENIAN_SLOVENIA.AL32UTF8
In /etc/php.ini I have:
default_charset = "UTF-8"
mbstring.internal_encoding = UTF-8
In /etc/httpd/conf/httpd.conf:
SetEnv NLS_LANG SLOVENIAN_SLOVENIA.AL32UTF8
In my PHP script "oracle.php" (file encoding is UTF-8) I have:
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" >
putenv("NLS_LANG=SLOVENIAN_SLOVENIA.AL32UTF8");
And then code similar to Example 2 in: http://www.php.net/manual/en/ref.oci8.php
Problem
When I am trying with PHP insert character "š" ( http://www.fileformat.info/info/unicode/char/0161/index.htm ) or some other special character into Oracle table and then do SELECT from this table I get value "??" which is wrong.
There is no problem for example with char "a". There is no problem inserting data with SQLPlus or Toad for Oracle - inserted data is always correct. There is no problem for example with echo("some_special_sharacters"); in PHP. I have no problems inserting data with PHP to MySQL database.
I have read this, but problem still exists:
http://www.oracle.com/technology/tech/php/pdf/globalizing_oracle_php_applications.pdf
Plese help.
Thanks!

How do you insert it? How do you select it? Where are you viewing the character? What is in the database after the INSERT?
(SELECT DUMP(col,1016) FROM tab)
-- Sergiusz

Similar Messages

  • Oracle 9.2 and PHP 5.1.x problems

    Hello everyone.
    I have an extremely frustrating dilemma, which has been a pain for quite a while now.
    I have been working with Oracle and PHP since Oracle 8.x and PHP4 and everything has been running smoothly. After we upgraded from PHP4 to PHP5 and from Oracle 8 to Oracle 9 I had to switch from using the old php_oracle extension to the OCI-libraries, but otherwise there were no problems.
    But now I am completely stumped. We are currently using Oracle version 9.2 and since our production enviroment is extremely large we are not going to upgrade to Oracle 10 or greater for many years.
    PHP though keeps on going forward. I am currently using PHP 5.1.0. I have tried several times upgrading to anything beyond that. 5.1.2, 5.1.4 and recently 5.1.6. But the oracle extensions just don't want to play anymore.
    I get the following error message everytime I start my apache 1.3:
    The procedure entry point OCILobRead2 could not be located in .. OCI.dll
    After reading this thread
    (Re: "The procedure entry point OCILobRead2 could not bel located in .. OCI.dll"
    I seem to know what the cause of the problem is. But how can I get past this? I would really like to upgrade our PHP version and still be able to use oracle. 5.1.0 is the last version which seems to work ok. Anything greater than that will not work at the moment.
    Any help would be greatly appreciated. Thank you very much.
    EDIT: I am using Windows 2000 and Windows 2003 Server. Unfortunately Linux is not an option where I work.
    EDIT2: Another edit. Actually I can start the thing up with PHP 5.1.2, but then I get a weird apache crash whenever I try to run a simple select query. No error messages and the log is empty. I am completely stumped.
    Message was edited by:
    Gameon
    Message was edited by:
    Gameon

    Thanks for the answers. The oci8.dll is uncommented naturally. Otherwise it would start up just fine, but I couldn't use the database functions.
    I got it working by installing 5.1.6, but replacing the oci8.dll with the one from the 5.1.0 -version. It's a very... desperate... solution, but at least it works.
    I'm gonna have to try to sell the idea of using the 10g client to our DBA. I don't think though, that he'll be very enthusiastic to set it up on our production servers. We'll see.

  • How do you insert special characters with imovie 08?

    How do you insert special characters into a project
    with imovie 08?

    Don't think that would work. Since my "system date" is already set at 2007. I have 2 imports, one has the year as 2048, and the other at 2016!! I don't know where they are getting these dates from, but they are not the system date.
    Were the files imported directly from a camcorder or from files already on your hard drive? In the first case the year may have been taken from the time "stamp" recorded when the footage was shot (which may or may not have been correctly set by the user). On the other hand, files imported from the hard drive seem to be keyed to the date the imported file is written to the "Events" folder which, of course, reflects the current system time/date setting. That's why I said you had to then import (re-import) the files from a hard drive source -- i.e., to ensure the DTG would be re-written.

  • How to insert & # special characters into oracle table?

    I have a text value which contains special characters such as & and #.
    After I pass from one page to another,
    TEST& becomes "TEST&amp;"
    I put " " on the above test, otherwise amp; will be truncated by OTN).
    TEST# becomes TEST (# is truncated).
    Actually the value is saved in table like this: "TEST&amp;"
    How to solve this problem?
    How to insert & into table without &amp;
    Thank you.
    Edited by: user628655 on Jul 27, 2009 9:47 AM
    Edited by: user628655 on Jul 27, 2009 9:49 AM
    Edited by: user628655 on Jul 27, 2009 10:39 AM

    Avoid doing that through a link. If this is a page item then submit the page and redirect to the target page using a branching. On the target page, create a computation to compute the target item using the original page item as the source. If you are talking about a report, use the id to pass through the link and fetch the text column in an on load computation.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    ------------------------------------------------------------------------------

  • Resource bundle UTF-8 encoding and Turkish special characters problem

    Hi dear developers,
    I'm developing a WebCenter Portal App in JDev 11.1.1.6.0 version. My project uses resource bundle for being multilingual. I have two bundles :
    1) <bundleName>_tr.properties (this the default one)
    2) <bundleName>_en.properties (this is the supported locale.)
    Now I have problem about the turkish characters in turkish bundle. When i run my project, it has a view just like this --> http://postimage.org/image/wr8nrm345/ (browser view) and http://postimage.org/image/3mf3fp2kl/ (bundleView)
    (Watch the "?" chars ! )
    You can see the bundle doesn't support Turkish special characters. How can i overcome with this problem?
    Thanks in advance.Regards
    erdo
    Edited by: erdo on 09.Oca.2013 17:24
    Edited by: erdo on 09.Oca.2013 17:25

    If you want to edit Unicode text resource you need a Unicode-aware text editor.
    You can search the Internet, but I had a good experience with Notepad++
    You may also ask in the JDeveloper forum ( JDeveloper and ADF ) if there is a way to resolve it. I found this: http://blog.newtrics.com/?p=242 , so I believe it may be possible somehow.

  • Using the Alt key and numeric code from Character Map to insert special characters in Office 2010 programs

    I am used to using the ALT key and specific numbers for characters from the Character Map to place characters in Office programs like Outlook, Word, Excel. I have a new Lenovo T530 Laptop running the Windows 7 Professional Operating System. I have MS Office
    2010 Home and Business. In previous versions of Office, this feature worked first time, every time. On this machine, it is a 'no go' situation. Lenovo tech support says it is a Microsoft issue and Microsoft says it is a Lenovo issue. Either way, I'm having
    difficulty resolving the issue and getting this wonderful featrure working for me. Any suggestions and guidance would really be appreciated. Thank you. 

    Hi,
    Haven't been verified this myself, but since this feature require to use the numeric keypad to input the value, I suspect the cause of the issue is the laptop keyboard.
    To workaround this issue, try enable the numeric keypad from your laptop keyboard, normally, we can enable it by press
    Fn + Num Lock.
    After that, try insert characters again.
    Max Meng
    TechNet Community Support

  • In Pages for iPad is it possible to insert special characters like those for logic and math?

    Hello there,
    Is there a way to digit special characters in Pages for iPad?
    I need to include in my document logical symbols.
    Thank you!

    Thank you Tom Gewecke for that app suggestion!  I've been wanting this for a long time.

  • Function to insert special characters

    I want procedure or function which can insert set of huge values say1000.. with special characters existing in spreasheet to a table.
    for example:
    L&T Infotech
    Ana's parlour
    Procter & Gamble
    ETSA Transmission Corporation T/As Electranet SA

    And the problem is where?
    You don't know how to work with spreadsheets (assuming excel) or Oracle?
    OK here is an example
    Table is as follows:
    SQL> create table mytable (col1 varchar2(100), col2 varchar2(100));
    Table created.Excel cell contains following value
    Latvia's men & women
    You need it to insert in the table
    The formula for insert creation is (one example of thousands of course ;)
    =CONCATENATE("INSERT INTO mytable (col1, col2) values ('";SUBSTITUTE(C16;"'";"''");"', 'aaa');")As a result you need in sqlplus do following
    SET SCAN OFF
    and then just call script with your calculated excel column values and for particular above mentioned column and table it would be:
    SQL> set scan off
    SQL> INSERT INTO mytable (col1, col2) values ('Latvia''s men & women', 'aaa');
    1 row created.Gints Plivna
    http://www.gplivna.eu

  • SQL Injections and XSS - Escaping Special Characters

    Hi, hope someone can help in regards to security and SQL Injections and XSS.
    We are using APEX 4.0.2 on Oracle 11.2.0.2.
    1. It seems the special characters we have entered into normal 'Text Items' 'Text Areas' etc are not being escaped (ie <,>,&, '). If I enter them into the field (ie Surname) they are saved as is into session state and the database - no escaping. Am I missing something such as an environment setting as I thought the "smart" oracle escaping rules would cater for this.
    Surely I don't have to manually do each of then.
    Just to confirm, am I looking in the correct places to assess if the characters are escaped or not - ie should they show as '&amp;&lt;&gt;' in session state and/or the database ?
    2. Also, for the Oracle procedures such as '‘wwv_flow.accept’ , ‘wwv_flow.show’ , 'wwv_flow_utilities.show_as_popup_calendar' - do these escape special characters. If not, then they must be vulnerable to SQL Injections attacks.
    Thx
    Nigel

    Recx Ltd wrote:
    Just to pitch in, escaping values internally (either in the database or session state) is extremely problematic. Data searches, string comparison, reporting and double escaping are all areas which suffer badly when you do this.
    Stripping characters on input can also cause problems if not considered within the context of the application. Names such as "O'Niel", statistical output such as "n < 300", fields containing deliberate HTML markup can be annoying to debug. In certain situations stripping is totally ineffective and may still lead to cross-site scripting.
    Apex applications that share the database with other applications will also be affected.
    The database should contain 'raw' unfettered data and output should be escaped properly, as Joel said, at render time. Either with Apex attributes or using PLSQL functions such as htf.escape_sc() as and when required.Do not needlessly resurrect old threads. After a couple of months watches expire and the original posters are not alerted to the presence of your follow-up.
    Shameless plug: If you are in the game of needing to produce secure Apex code, you should get in touch.This crosses the line into spam: it violates the OTN Terms of Use&mdash;see 6(j).
    Promotional posts like this are liable to be removed by the moderators.

  • How to insert special characters ,?

    Hi, guys
    I want to insert some special characters such as , ,,into Oracle,
    for instant: insert into test (special_no) values (' ');
    but the system can not read and show the characters, and just process the characters as null. Could you please tell how I can do to make the system can read the characters? Maybe should I change the some Oracle environment parameters?
    By the way, I immigrated data and tables from MiniSQL to Oracle. How can I check the all data immigrated are correct? In the Mini SQL there is a command 'realshow' to show all data and tables in the database. Is there a command like this in Oracle?
    Thanks ahead.
    Agurri

    NLS_LANG could help but I am not sure about that. You should be able to get any character in the database, that the database supports. What character set is the database created with ?
    You can also use the numeric value for the char
    insert into x (y) values (chr(13)); or whatever.
    Ronald.
    http://ronr.nl/unix-dba

  • How to insert special characters in pdf comments

    Now, we are ready to go "no paper" workflow, and so mark anything on pdf file, but we cannot insert most of special characters in PDF comments. Same as here, and the xml entity is "&PSgr;", "how to archive it?

    >what the Character Map is?
    You don't know how to use Google?
    Character map is a standard part of Windows for using special
    characters with any program.
    In Windows XP, Start > All Programs > Accessories > System Tools >
    Character Map.
    Aandi Inston

  • Text fields special characters problem in forms created with ID

    Hi there,
    I'm creating form document with ID.
    The problem with special characters appears after exporting file to interactive pdf.
    When filling up text field, special characters (polish language specials in my case) are replaced by squares.
    I do not know if this is a ID problem (and I should set encoding during pdf creation somehow) or Acrobat/Reader problem (tried both and also in Polish or English versions).
    Some help would be appreciated.

    I am Creative Cloud User and downloaded fresh ID less than 2 hours ago.. And honestly the last thing I would think about was updating.
    But in fact - it was the problem.
    So thank you very much for help!

  • Special Characters problem in PI 7.1

    Hi,
    We have simple integration from R3 to JMS. from R3, idocs contain special characters, and they are getting converted in to different chanracters in integration engine. So making the output data currupted.
    I tested the same message in mapping test tool and the target message contains actual special charcters. Below is the example,
    Input: 
    i was thinking of using XMLAnonymizer, but the problem is in integration engine itself. I can see invalid output in SXMB_MONI.
    so could some one help me how can i fix this issue?
    Many thanks in advance.
    Regards,
    Prasad..

    Hello,
    Please check this document to sort out your issue:
    How to Work with Character Encodings in Process Integration (NW7.0):
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42
    Br,
    Dzmitry

  • Metadata special characters problem

    You would be forgiven for thinking it easy to add a caption for each image to identify the photographer and her credentials. Metadata is there for that purpose and the IPTC "Author" field seems an obvious choice.
    However, most letters-after-your-name will contain special characters eg.
    Gordon Bennett FRPS; MPAGB; EFIAP/b.
    and these cause huge problems to the Adobe products that seem to have gone un guided.
    If these are entered into the Metadata in the File Info panel in say Photoshop or Bridge they are recorded correctly. When reading the Metadata from file in Lightroom (Vista version) however, only the text up to the first semicolon in the above example is transferred. The same problem occurs with the slash. Thus all the Lightroom modules work on incomplete data.
    (I have neither special character set as a keyword seperator in Preferences).
    Is there some coding tag that can be wrapped round this text to ensure it is published correctly by the web module ?

    Hi Kenneth,
    Thanks very much for your comments.
    In Preferences>File Handing I have de-selected the option to have Lightroom use forward slash as a keyword seperator. My understanding is that therefore it should not do so.
    Do you mean that Vista overrides this? or is it simply the Vista version of Lightroom that is doing it.
    I had noticed that if a comma is used to seperate keywords that both Bridge and Photoshop replaces them with semicolons and it seems that you cannot prevent this.
    Do you know something about how this mechanism works and if it can be varied?
    As for an answer to your question of "what shows up in the fileds" I don't think you can tell. Although you can in Bridge/Photoshop by examining the File Info panel, in Lightroom it just disappears into the "catalogue" and cannot be examined. It is displayed of course in the Lr metadata panel but that is where we started, with truncated fields !! However if you save the apparently truncated metadata xmp in Lr then force a read again in Bridge, the full data seems to still be there. Thus it would seem this is a problem specific to Lr and the way it displays metadata containing special characters.
    Any further info on the Vista issue would be very welcome.

  • Flash Builder 4.6 mobile connetion oracle and php

    Hi everyone im new in flash builder and as far i know Flash Builder 4.6 gives you the option to create sample PHP code, but only gives an option for a MySQL database.  Does anyone have some PHP sample code for using Oracle? I try few proyect and they work perfect but i dont know how to do it for oracle
    Thnx a lot XD

    After searching on internet and have hands on this problem, finally found the solution.
    SAMSUNG Galaxy Y S5360 has CPU 830 MHz ARMv6 and minimum requirement of minimum system requirements for AIR 3.3 Beta on Android :
    CPU: ARMv7 processor with Vector FPU, Minimum 550MHz, OpenGL ES2.0, H.264 & AAC H/W Decoders OS: Android 2.2, 2.3, 3.0, 3.1, 3.2 & 4.0 RAM: 256MB RAM
    Later I used a Motorola mobile handset with higher version my .apk file worked well.
    Click here For Samsung Galaxy Y S5360 Phone Specification
    thanks to everyone for your efforts.

Maybe you are looking for