As of Oracle 10, when using GsoracleConnection charConversion/charGS/ncharGS
mode #UTF8, it is now necessary to set the environmental variable $NLS_LANG
to an appropriate character set with suffix *.UTF8
Failure to do this will cause Oracle to *also* perform UTF8 conversion
on a string that has already been converted to UTF8 by GemConnect. If
data is *only* read/written by GemConnect, then you may not even notice
a problem, as the double-conversion preformed during a read will cancel
out the double-conversion performed during the write. But incorrect results
will occur if data is read/written to Oracle outside of GemConnect.
Another side-effect is that the extra conversion could result in increasing
the size of the string stored in Oracle, potentially causing it to overflow
the allocated space for a string that would have otherwise fit. This case
would trigger Oracle error:
ORORA-12899: value too large for column "NAME" (actual: XX, maximum: XX)
For US customers, the correct value for $NLS_LANG would be AMERICAN_AMERICA.UTF8.
Similar values would apply for international customers, according to their
locale.
This requirement is also documented in the GemConnect Programming Guide,
Section 3.1.
Set $NLS_LANG to the appropriate value.
Last updated: 10/2/23