encode URI

    If you have to deal with web sources like URL with parameters (e.g.Twitter Search) you always have to convert UTF characters to be URI conform.

     

    Some build a mapping tables but I think the right way is using Jscript encodeURI function because there are endless of UTF chars...

     

    This is a simple example for a Jscript macro code in QV:

     

    function encode (uri){

              return encodeURI(uri);

    };

     

    This is an example how to use it in the Load Script:

     

    LOAD ....

    FROM [encode('http://search.twitter.com/search.atom?lang=en&q=$(q)'] (XmlSimple, utf8, Table is [feed/entry]);

     

    - Ralf