Shail Paras
Shail Paras

Reputation: 1163

save ansi special character in oracle database using php

Can somebody tell me how can i save œ which comes from ALT+0156 i tried to save in database but it is showing ¿

I have looked around but couldn't find any way. Currently i'm using

NLS_LANGUAGE =  AMERICAN
NLS_CHARACTERSET = 'AL32UTF8'
CHARACTER SET   WE8ISO8859P1

Actually i need to save UTF8 data in database but these symbols not coming in right format. Please tell me what i'm missing.

Even i ran a query in Oracle Sql Developer Tools

select 'œ' val from dual;

It returns

val => ¿ //as result

Upvotes: 1

Views: 496

Answers (1)

pOrinG
pOrinG

Reputation: 935

Even I faced similar issues with special characters in Oracle DB.

Your oracle might be compatible with that particular special character but your server/system is not hence you need to add an environmental variable named NLS_LANG.

For Linux/Unix you can simply add it in the .profile/.bash_profile

Eg. export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

For Windows you can right click your

PC -> Goto properties -> Advanced system settings -> Environmental Variables. 

Path:[Control Panel\System and Security\System -> Advanced system settings -> Environmental Variables. ]

And add a NLS_LANG variable in system variables section.

Note: The value to save in this NLS_LANG environmental variable is returned using below query [In Windows/Linux both]:

 select userenv('language') from dual

Note that you need to restart your windows system after adding the variable.

Try the following reference link & do the necessary configurations : link and it should hopefully work out.

Upvotes: 1

Related Questions