Oracle SQL Developer Coding

I have Oracle SQL Developer (3.1.07) and I am trying to work with a database that uses WE8ISO8859P1 encoding:

 SELECT * FROM nls_database_parameters WHERE parameter = 'NLS_CHARACTERSET'; 

I have problems saving packages containing Unicode characters. When I open a previously saved package, all Unicode characters refer to 'ΒΏ' .

What parameters do I need to change to force SQL Developer to keep these characters? I tried setting the encoding of the environment to 'ISO-8859-15' and some other encodings, but that will not help.

+7
source share
4 answers

If your database encodes text in single-byte encoding other than Unicode (for example, ISO-8859), any character that is not in the character table will be considered invalid and replaced with a placeholder. You cannot return from this, information is lost.

This can usually work when storing data, but as for the source code, you have no control over how Oracle will encode your strings.

If your database is configured to use such a coding scheme, you probably should not write code that violates its rules.

+1
source

You might need character set migration

http://docs.oracle.com/cd/B10501_01/server.920/a96529/ch10.htm#1656

in the Oracle documentation

0
source

At least in order to open PKG in sql-developer, you can quickly try and see if it works: -

Change the SQL Developer encoding to "unicode-utf-8", which is the default for later versions.

In the end, you will need to switch to porting the database charset to β€œAL32UTF8” to avoid other problems (such as data) due to this char set.

0
source

If you look at USER_SOURCE, you will see that the source code that is stored / interpreted by the database will be in the VARCHAR2 column, so use the database character set. Therefore, your source code should be in WE8ISO8859P1.

Theoretically, if the client and the database use the same character set, then the database will not try to translate the character set, and you can sneak into a sequence of bytes, which, according to the database, are WE8ISO8859P1, but will make sense in unicode . However, at some point, someone will use the wrong client and it will break.

You do not need Unicode for identifiers, etc. in the code, so I assume it is in string literals. You better keep them in a table (NVARCHAR2 column) and select them in your code, rather than hard code them. If this is not possible, you can use UNISTR and hard-code the corresponding hexadecimal values.

0
source

All Articles