PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • 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.
Versions 15 and later
Android This function is now available for the Android applications.
New in version 15
Android This function is now available for the Android applications.
Android This function is now available for the Android applications.
Versions 16 and later
Universal Windows 10 App This function is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This function is now available for the Windows Phone applications.
Universal Windows 10 App This function is now available for the Windows Phone applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
WEBDEV - Browser code This function is now available in browser code.
New in version 22
WEBDEV - Browser code This function is now available in browser code.
WEBDEV - Browser code This function is now available in browser code.
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.

AndroidAndroid Widget JavaPHP This parameter is not available.
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.

AndroidAndroid Widget JavaPHP This parameter is not available.
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.

AndroidAndroid Widget JavaPHP This parameter is not available.
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230std.dll
Windows Mobile wp230std.dll
WEBDEV - Browser code WDJS.DLL
Java wd230java.jar
Linux wd230std.so
Android wd230android.jar
Minimum required version
  • 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
Jan. 20 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
Jan. 20 2018