0

I'm running an SQL file with Shell script (.sh) contains an update statement but one of the columns is not inserted as needed, I tried to convert the file encoding to UTF-8 with notepad++ but the issue still in place.

bellow you will find the current value of the column and the correct version of it

current (issue):
R��servation

required:
Réservation
AbdeAMNR
  • 165
  • 1
  • 5
  • 18

1 Answers1

1

You must set the encoding of your shell according to NLS_LANG value.

On Windows it would be for example:

C:\>chcp 65001
Active code page: 65001

C:\>set NLS_LANG=.AL32UTF8

C:\>sqlplus ...

See also OdbcConnection returning Chinese Characters as "?"

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • how to do it the .sh file ? – AbdeAMNR Nov 14 '18 at 14:12
  • @AbdeAMNR, with `NLS_LANG` you tell the Oracle DB which encoding is used in your file. If you converted the file to UTF-8 then you must set `NLS_LANG=.AL32UTF8` (language and territory are optional). If you work just with your terminal and sqlplus run `locale charmap` or `echo $LANG` to interrogate the encoding of your terminal. See also https://stackoverflow.com/questions/33783902/odbcconnection-returning-chinese-characters-as/33790600#33790600 – Wernfried Domscheit Nov 14 '18 at 14:24