LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UTF-8 codes in the URL input of data socket

Solved!
Go to solution

Hi All,

 

I am trying to download files from a server using the Data Socket functions. I tried using the URL

**http://stb.site90.com/Plugins/LV GUI (CE).zip*[text] on the Data socket input terminal and was able to download the corresponding file (Code Attached ). But on copying the URL to browser (Google Chrome) the address bar displayed it as

**http://stb.site90.com/Plugins/LV %20GUI%20(CE).zip*[text].

 

I discovered that the browser tends to replace certain special characters in the URL with their corresponding UTF-8 codes.

  1. Are there any such exceptions/ special characters (Like: !, #, &,^ etc) that Data Socket will not understand, which should be considered while providing input to Data Socket functions?
  2. Should the special characters always be replaced with their corresponding UTF-8 codes before using the URL as Data Socket input?

*[text] is appeneded to the URL so that Data Socket functions returns the output in unformatted text.

**Please use a public URL. The above URL is provided just for a reference.

 

Simple Downloader.png

 

 

Regards,

S.P.Prasaanth

0 Kudos
Message 1 of 4
(3,460 Views)
Solution
Accepted by topic author Prasaanth

Hi Prasaanth,

 

LabVIEW comes with ready-to-use functions to convert from and to "escaped" URLs.

 

Open QuickDrop and type "URL": you will easily find "Escape HTTP URL" and "Unescape HTTP URL". Then study their block diagram to know how they work and which chars get replaced by %-codes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,448 Views)

Hi GerdW,

 

Thanks for the reply.

 

I have clarification to make; I am able to download the file even if I give the URL as such. But are there any possible cases in which, presence of special characters will cause issue with Data Socket functions. If any please let me know, so that I could integrate the module you mentioned into my code.

 

Regards,

S.P.Prasaanth

0 Kudos
Message 3 of 4
(3,441 Views)

Hi Prasaanth,

 

read this! It's not specific to DataSocket, not even to LabVIEW. It describes the standard used to encode URLs…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(3,417 Views)