Spool Unicode data in sqlplus to ISO-client without character set conversion

nlsoraclesqlplusunicodeutf-8

I'm currently facing the following problem:

We have an Oracle 11g database with character set AL32UTF8, and an sqlplus-client with NLS_LANG=GERMAN_GERMANY.WE8ISO8859P1.
Stored in the database are various non-ISO8859-1 characters.

Now, when the client connects to the database and tries to spool these special characters, a character set conversion takes place according to the client's NLS_LANG setting and the special characters are lost.

Unfortunately, changing the client-NLS_LANG isn't easily possible (legacy application – it's complicated…).

Is there an easy, or standard way to spool this data without losing these special characters?

I've thought about encoding the data in base64, spooling it, and then decoding it client-side.

But is there a better way?

Best Answer

Without setting NLS_LANG it's going to be tough.

How good are you at simple coding or parsing/manipulating strings?

You can do:

select DUMP(field) from table;

Then write some sort of conversion code to parse the comma-delimited numbers from the dump into Unicode.