Other apps (#13) - New lines in keywords (#186) - Message List
I'm having a problem with the newlines in keywords. The textarea is encoded with utf8_encode() (PHP) but it's not passing through new lines in the keywords?
Here is some sample code:
$freetext = $client->new_keyword('ft', utf8_encode($keywords), NULL); // Build keywords $client->searchData->keyword = $freetext; // Store the keyword array $client->set_search_data($subfqdn, $client->searchData, TRUE); // Store the TXT records
Thank you for this report. I now have a confirmation from our developers that in the current implementation, keywords don't support carriage returns because a keyword value is defined as a "token" in XSD, which causes all whitespace sequences being collapsed into single spaces.
This will be rectified in the next release of the software when the definition is changed to "string", which preserves whitespace (if properly encoded, see below).
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:typ="http://xmlns.telnic.org/ws/nsp/client/searchdata/types-1.0"> <soap:Header/> <soap:Body> <typ:setSearchDataRequest domainName="cartman.tel"> <typ:searchData> <typ:keyword field="ft" value="line1
line4"> </typ:keyword> </typ:searchData> </typ:setSearchDataRequest> </soap:Body> </soap:Envelope>
Note that it's not sufficient to simply type returns into the SOAP request; these will disappear due to the usual XML attibute value normalization (http://www.w3.org/TR/2008/REC-xml-20081126/#AVNormalize).nadya07/06/09 10:49:23
Thanks for that...
So, would it work to exchange a carriage return for a
using string replacement with PHP, then to encode the lot with UTF-8? Or have I not understood properly?
This seems to be the only thing now not working with keywords, everything else seems fine which is good :)