Oracle Error ORA-24508: Buffer is not aligned correctly.

Oracle Error Message

ORA-24508: Buffer is not aligned correctly.

Reason for the Error

Alignment error ocurred in buffer when converting between character sets.

Solution

Align buffer appropriately. For UTF16 buffer, pass a ub2 pointer.