There are a few potential causes here.
Normally the database will automatically convert charactersets *assuming* the client settings have been correctly set.
But also this can depend on the client tools being used to both edit and run the file.
For example, if I cut/paste your code on my *windows* machine, the code and the result are fine:
create or replace package pk_constants is
lv_pound constant char(1) :='£'; -- for germany and europe countries
end pk_constants;
/
SQL> select text from user_source
2 where name like 'PK_CON%';
TEXT
---------------------------------------------
package pk_constants is
lv_pound constant char(1) :='£'; -- for germany and europe countries
end pk_constants;
but if that character was (say) arabic, then the code is this:
create or replace package pk_constants is
lv_pound constant char(20) :='بعض المف';
end pk_constants;
/
but pasted into windows, the command prompt doesn't support arabic and I get garbage
SQL> select text from user_source
2 where name like 'PK_CON%';
TEXT
---------------------------------------------
package pk_constants is
lv_pound constant char(20) :='??? ????';
end pk_constants;
So check that
- the file was saved correctly
- the run time environment was correct for nls settings
- the database charactersets are in alignment