PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Characters allowed in an encoded URL
  • Special cases
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Decodes an encoded URL (which means with characters in %xx format).
Note: The syntax of the URL is not checked.
Example
// Decodes a URL
DecodedURL is string = URLDecode("http://mysite/my%20report")
// DecodedURL contains: http://mysite/my report
Syntax
<Result> = URLDecode(<URL to Decode> [, <Encoding/Decoding format>])
<Result>: Character string
Character string containing the decoded URL. The following characters are transformed:
  • '+' are transformed into space characters
  • %xx' (where xx is an hexadecimal value) are replaced by the character whose hexadecimal value is xx.
<URL to Decode>: Character string (with quotes)
Encoded URL to decode.
<Encoding/Decoding format>: Integer constant
Versions 22 and later
Specifies the type of encoding performed. This parameter must be identical to the one chosen during the coding.
encodeURLToAnsiURL format. The encoded text only contains characters allowed in a URL. The decoded text is an ANSI string. This constant corresponds to the encodeURLFromAnsi constant used in URLEncode.
encodeURLToUTF8
(Default value)
URL format. The encoded text only contains characters allowed in a URL. The decoded text is a UTF-8 string. This constant corresponds to the encodeURLFromUTF8 constant used in URLEncode.
encodeURLToUnicodeURL format. The encoded text only contains characters allowed in a URL. The decoded text is a Unicode string. This constant corresponds to the encodeURLFromUnicode constant used in URLEncode.

New in version 22
Specifies the type of encoding performed. This parameter must be identical to the one chosen during the coding.
encodeURLToAnsiURL format. The encoded text only contains characters allowed in a URL. The decoded text is an ANSI string. This constant corresponds to the encodeURLFromAnsi constant used in URLEncode.
encodeURLToUTF8
(Default value)
URL format. The encoded text only contains characters allowed in a URL. The decoded text is a UTF-8 string. This constant corresponds to the encodeURLFromUTF8 constant used in URLEncode.
encodeURLToUnicodeURL format. The encoded text only contains characters allowed in a URL. The decoded text is a Unicode string. This constant corresponds to the encodeURLFromUnicode constant used in URLEncode.

Specifies the type of encoding performed. This parameter must be identical to the one chosen during the coding.
encodeURLToAnsiURL format. The encoded text only contains characters allowed in a URL. The decoded text is an ANSI string. This constant corresponds to the encodeURLFromAnsi constant used in URLEncode.
encodeURLToUTF8
(Default value)
URL format. The encoded text only contains characters allowed in a URL. The decoded text is a UTF-8 string. This constant corresponds to the encodeURLFromUTF8 constant used in URLEncode.
encodeURLToUnicodeURL format. The encoded text only contains characters allowed in a URL. The decoded text is a Unicode string. This constant corresponds to the encodeURLFromUnicode constant used in URLEncode.

Remarks

Characters allowed in an encoded URL

The list of acceptable characters for an encoded URL is as follows:
;/?:@
&=+$,
-_.!~
*'(|)
%#the digitsthe letters (uppercase and lowercase characters)

Special cases

  • Decoding an empty URL (empty string) returns an empty URL.
  • The %26%238364%3B string whose value is #8364; is replaced by the € symbol.
  • The % characters followed by invalid characters are ignored.
Component : wd240std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Example 01
PROCÉDURE WS_LoginToken02(Username string, Password string)

ArrResultado is array of string

IF InternetConnecté() = True AND VerificaWebservice("http://187.95.103.110:8089",3) = True

bufResultado is Buffer = ""

///Metodo nro 2 via RESTSend

cMyRequest is restRequest
cMyRequest..URL = "http://188.95.103.111:8089/Token"
parametros is string = "grant_type=password&password="+Password+"&username="+Username
cMyRequest..Content = URLEncode(parametros)
cMyRequest..Method = httpPost //get
cMyResponse is restResponse = RESTSend ( cMyRequest )

//Info(cMyResponse..Content)

bufResultado = cMyResponse..Content

//{
//"access_token":"PT3jX8camZdWDUJNRiszFuxnw-GKa259E1Eiykt92IWNefIOVpWcW7yVtG3Cr-1K87keWNdFTRN64vjdaPn3vDIR51fUgZaPdtBM7ouJX0iLTjDOwT4xqlthn_rR9svmujSENIlW_wNKidceAmoykIBjXEDz5cuOvwELXVqBBKf1_zSzXTmGMVo7ifV6QiHZ7DuQt_qvJKWx06nR7CBVrA",
//"token_type":"bearer",
//"expires_in":1209599,
//".issued":"Wed, 17 Jan 2018 18:21:50 GMT",
//".
BOLLER
20 Jan. 2018
Example 02
WS_LoginToken01(Username string, Password string)

bufResultado is Buffer = ""

///Metodo nro 1 via HTTPREQUEST

s_parametros is string

s_parametros = "grant_type=%1&password=%2&username=%3"

s_parametros = URLEncode(StringBuild(s_parametros,"password",Password,Username))

IF HTTPRequest("http://188.95.103.111:8089/Token","","",s_parametros) THEN //post
bufResultado = HTTPGetResult()
ELSE
Error(ErrorInfo())
END

//{
//"access_token":"PT3jX8camZdWDUJNRiszFuxnw-GKa259E1Eiykt92IWNefIOVpWcW7yVtG3Cr-1K87keWNdFTRN64vjdaPn3vDIR51fUgZaPdtBM7ouJX0iLTjDOwT4xqlthn_rR9svmujSENIlW_wNKidceAmoykIBjXEDz5cuOvwELXVqBBKf1_zSzXTmGMVo7ifV6QiHZ7DuQt_qvJKWx06nR7CBVrA",
//"token_type":"bearer",
//"expires_in":1209599,
//".issued":"Wed, 17 Jan 2018 18:21:50 GMT",
//".expires":"Wed, 31 Jan 2018 18:21:50 GMT"
//}

ArrResultado is array of string

IF bufResultado <> "" THEN

bufResultado = Replace(bufResultado,Charact(34),"")

access_token is string = BuscaValorJson(bufRes
BOLLER
20 Jan. 2018