Try to set your DAD
PlsqlNLSLanguage DANISH_DENMARK.UTF8
or even better
PlsqlNLSLanguage DANISH_DENMARK.AL32UTF8
When you save your file as ANSI
it typically means "Windows Codepage 1252" on Western Windows, see column "ANSI codepage" at National Language Support (NLS) API Reference. CP1252 is very similar to ISO-8859-1, see ISO 8859-1 vs. Windows-1252 (it is the German Wikipedia, however that table shows the differences much better than the English Wikipedia). Hence for a 100% correct setting you would have to set PlsqlNLSLanguage DANISH_DENMARK.WE8MSWIN1252
.
Now, why do you get correct characters when you save your file as UTF8-BOM
, although there is a mismatch with .WE8ISO8859P1
?
When the browser opens the file it first reads the BOM 0xEF,0xBB,0xBF
and assumes the file encoded as UTF-8. However, this may fail in some circumstances, e.g. when you insert text from a input
field to database.
With PlsqlNLSLanguage DANISH_DENMARK.AL32UTF8
you tell the Oracle Database: "The web-server uses UTF-8." No more, no less (in terms of character set encoding). So, when your database uses character set WE8ISO8859P1
then the Oracle driver knows he has to convert ISO-8859-1 characters coming from database to UTF-8 for the browser - and vice versa.