Search code examples
oracle-databaseplsql

How to use special characters in Oracle PL/SQL?


I have the following package:

    CREATE OR REPLACE PACKAGE BODY MyPackage is
        function Somefunction return varchar2 is
        begin
            return 'some text with special characters like é or è';
        end;
    end package;

The package compiles however when executed, the text returned doesn't include the special characters:

    some text with special characters like � or �

I'm using PL/SQL allround automation and, as far as I know, it's configured to use UTF-8 charset:

enter image description here

Unicode is also enabled as can be seen in the screenshot here.

And running the following query:

    select * from NLS_DATABASE_PARAMETERS where parameter='NLS_CHARACTERSET';

return:

    AL32UTF8

How can I solve that?


Solution

  • Solution as per @AlexPoole comments :

    Add the following environment variable in Windows :

    NLS_LANG : LANGUAGE_COUNTRY.UTF8