Non-printable characters in Informix esql/C query

I am tired of searching about how to rectify this problem.

I have a query being built in eSql/C codes. I get an input string from external sources - C++ or Java code... Now when the query builds and executes - it gives the error message -202 and fails to execute which is as follows on the IBM documentation:

-202 An illegal character has been found in the statement.

A character that cannot be interpreted as part of an SQL statement is
embedded in this statement. If a program constructed the statement, the
character might be a nonprinting control character. Make sure the
statement contains only printable ASCII characters, and reexecute it.
The special character is ^_ (control-underscore, ASCII - 31 in decimal). I don't know how this is getting into the input string :cry: :eek: . Is this normal/common? I use C-style character arrays to store the input strings and then dynamically build the query string. Any insights as to why this is happening and how to resolve this or any other prospect of something similar to it but different coming into the picture later on...?

Thanks for all the help until now and for having a patient look. Best regards.
[1216 byte] By [exterminator] at [2007-11-19 19:45:49]
# 1 Re: Non-printable characters in Informix esql/C query
I don't know how this is getting into the input string

Two suspects:

1) Using non unicode version of exec with unicode string from java etc.

2) Using wrong NLS (national language support) settings.

Hope it hepls.
Krzemo at 2007-11-9 13:43:17 >
# 2 Re: Non-printable characters in Informix esql/C query
Thanks Krzemo, I'll have a look into this... Regards..
exterminator at 2007-11-9 13:44:18 >