Error searching a data source from Cognos for Unicode

Technote (troubleshooting)

Problem(Abstract)

Using 'like' or 'in' functions in a text box prompt causes prompt validation to fail and can cause report execution to fail if the prompt is validated against 4-byte long characters, such as a few Unicode Extension B-Han Characters

Symptom

When trying to validate the filter the following error occurs. UDA-SQL-0107 A general exception has occurred during the operation "{0}". "RSV-VAL-0004 Unable to find query information for the item First Name" "RSV-VAL-0004 Unable to find query information for the item First Name"

Cause

This has been identified as a configuration issue under APAR PM95912

Environment

Any environment against DB2 using unicode characters. Make sure to follow this technote as well: 1645040 to enable unicode characters.

Diagnosing the problem

If the symptoms occur and the text entered to validate the prompt are 4-bytes long, follow 'resolving the problem'

Resolving the problem

This is essentially a configuration issue.

The root cause of this problem is that some literal (particular, the first of the two Chinese strings listed in Step 7 of the testcase) contains characters, each requiring 4 bytes (making up what is known as "surrogate pair") of utf-16 encoded storage, whereas Cognos 10 (starting from 10.2) has been configured to allocate 2 bytes for each character. As a result, a buffer allocated to hold the literal is not created sufficiently large, hence causing the error (buffer overflow). Note that the allocation of 2 bytes per character is sufficient for almost all alphabet-based character sets.

To resolve the issue in Cognos 10.2, the end user needs to change the configurable setting (2 bytes) to 4 bytes. Here are the steps:

1) Edit <C10_install_dir>\configuration\i18n_res.xml

2) Change the following line <memoryManagement UTF8BytesPerCodePoint="2.5" MaxUTF16BytesPerCodePoint="2"/> to <memoryManagement UTF8BytesPerCodePoint="2.5" MaxUTF16BytesPerCodePoint="4"/>

3) Reboot TomCat.

If the issue needs to be resolved in Cognos 10.1 and/or previous releases, the setting MaxUTF16BytesPerCodePoint needs to be ported over.