I’ve got a cgi-program which ist connected to my Tamino-Database as a HTTP-Client. Now I want to send a query like:
LOB[LOBName=“Business & Consumers”]
in the cgi-Program.
If I send this query in the Tamino Interactive Interface i’ve got no problems. But in the cgi-program the answer of tamino is: xql:queryLOB[LOBName="Business </xql:query>
The reason is that ‘&’ is a parameter separator in the ? part of URLs or in the POST body.
So you would have to write %xx where xx is the hex value of the ‘&’ character codepoint . In general
In Jscript you can call the routine escape to escape parameter values like queries.
You can call it form Visual Script also.
Like this var escapedQuery = escape(‘LOB[LOBName=“Business & Consumers”]’);
I don’t know what language you are using in your CGI program - If it is Perl then $query=~s/([^a-zA-Z0-9_.-])/uc sprintf(“%%%02x”,ord($1))/eg; will do the right thing.(believe it or not ) CGI.PM has a support routine somewhere.
In java there is a routine that does the same thing and so do most cgi function support libraries I’ve seen.
However this algorthim won’t work on UTF-8 with characters greater that “7F” - at least not with the current version of Tamino.
If you use the Tamino DOM APIs to talk to Tamino this work is all done for you.