HTTPServer

4D Component which includes methods to help your web developing.

encodeURIComponent()

encodeURIComponent (textToEncode) -> text

Name Type   Description  
textToEncode text Text to encode  
return text Encoded text  

This method encodes a URI component by replacing each characters with escape sequence representing the UTF-8 encoding of the character.

In textToEncode parameter, pass a text that you want to encode.

This method escapes all characters except: A-Z a-z 0-9 - _ . ! ~ * ‘ ( )

Example

C_TEXT($original_t;$encoded_t;$decoded_t)
$original_t:="ABC123あいう"
$encoded_t:=encodeURIComponent($original_t) // returns ABC123%E3%81%82%E3%81%84%E3%81%86
$decoded_t:=decodeURIComponent($encoded_t) // returns ABC123あいう