unicode/symbols in url with httprequest

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
macroman
Pro Scripter
Posts: 91
Joined: Mon Jun 02, 2014 5:32 am

unicode/symbols in url with httprequest

Post by macroman » Thu Dec 01, 2016 2:56 pm

Hello all, I'm trying to execute this via httprequest but it's not working... how do I make this work?

Code: Select all

HTTPRequest>https://dummyimage.com/hd1080/000/fff/image.jpg&text=☆☆☆ STARS,E:\s\6.jpg,GET,,,,,,
trying to have the stars in the url which works fine in a normal browser:

Code: Select all

☆☆☆

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: unicode/symbols in url with httprequest

Post by Marcus Tettmar » Mon Dec 05, 2016 9:15 am

Hi,

First you need the ? character before text, not & which is for subsequent parameters.

You also need to URL encode the data. This works:

Code: Select all

Let>URL=https://dummyimage.com/hd1080/000/fff/image.jpg?text=%E2%98%86%E2%98%86%E2%98%86%20STARS
HTTPRequest>URL,%SCRIPT_DIR%\t2.jpg,GET,,hres
I used the encoder/decoder here:
http://meyerweb.com/eric/tools/dencoder/

If you don't know what the data will be at runtime, there's a URL encoding function you can use here:
viewtopic.php?f=2&t=9260
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts