0

I'm changing a php server application from windows to Linux, when I query special characters from the Oracle database I always get ?. on the windows server I make this query

SQL> select length ('ñ') from dual;

LENGTH ('Ñ')
-----------
           1

and in linux it generates this

SQL> select length ('ñ') from dual;

LENGTH ('??')
------------
            2
  • SQL> select value from nls_database_parameters where parameter = 'NLS_CHARACTERSET'; VALUE ---------------------------------------- WE8ISO8859P1 SQL> select value from v$nls_parameters where parameter = 'NLS_CHARACTERSET'; VALUE ---------------------------------------------------------------- WE8ISO8859P1 – Julian Puentes Uribe Oct 17 '17 at 21:59
  • Please edit you question for additional information instead of putting them as comment. – Wernfried Domscheit Oct 18 '17 at 07:39

1 Answers1

0

You must set your NLS_LANG variable according to character set of your Linux.

Check character set with locale charmap or echo $LANG Then set NLS_LANG accordingly, e.g. export NLS_LANG=AMERICAN_AMERICA.AL32UTF8

See OdbcConnection returning Chinese Characters as "?" for more details.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110