Sorry Marcel, didn't notice your reply until now.

NLS_LANG shouldn't be set to the characterset of the DB but to the characterset of the client.
It is used so the DB knows FROM what to convert incoming stuff from the client.
Setting it equal to the DB Characterset is a mistake that is very often made, and can lead to misformed characters in the database.

That being said, I highly doubt that it's a characterset issue.
It could have been with any real-world data.
But the test statement I put in my original post uses just a long string of nothing but repeated capital X's.
If there was a characterset mismatch it would mean that the X consists of more bytes in one characterset than in the other.
Possible, but because the test string I'm trying to write is *only* X's
Each X on client side consists of the same amount of bytes.
Each X on DB side consists of the same amount of bytes.

So if e.g. on DB side the X would be 2 bytes and on client side 1 byte, I would expect to only be able to write floor(32.767 / 2) = 16.383 X's.
But what I see is that I can write 32.512 X's.
That's 255 bytes short of the maximum of 32.767, Which I can not explain with characterset issues.


Erik van Roon
EvROCS