TURL_ToHTTP |
Encodes a text in HTTP.
Syntax
TURL_ToHTTP ( switches ; text )
Parameters
switches | determine the behavior of the function |
text | either the name of a text field or a text constant (in quotes) that you want converted to HTTP |
Switches
You can leave switches empty or add this switch:
-UpperCaseHex | make the encoded string contain only uppercase hexadecimals, like for example %0A (instead of %0a) for the linefeed character. |
Returned Result
Data type returned
Text
Result
The result is the HTTP encoded text. Certain special characters and all “high ASCII” characters (characters with an ASCII value above 127) must be encoded when converted to HTTP.
TURL_ToHTTP returns the contents of the specified field or text value encoded in HTTP. The special characters that must be encoded are:
; / ? : @ = & > < # % { } ' | \ ^ ~ [ ] ` ¨ © " (space)
plus all high ASCII characters. These characters are encoded using the formula %nn where nn is the hexadecimal value that represents the character in the International Standards Organization (ISO) Latin-1 character set. For example, %20 is the encoded value for the space character.
Originated in
Troi URL Plug-in 1.2
Compatibility
FileMaker Pro 16 to 19
Considerations
This function also runs in a runtime created with FileMaker Pro Advanced.
NOTE Use the TURL_ToURLEncoded function if you want to encode higher Unicode characters too.
Example
Set Field [ result ; TURL_ToHTTP ( "-unused" ; "Hello World!" ) ]
gives this result: “Hello%20World!”
Example 2
In a database you have defined a text field named theURL which contains “<http://www.filemaker.com>”. Create a script with this step:
Set Field [ result ; TURL_ToHTTP ( "-unused" ; theURL ) ]
Then the result will contain the encoded text:
%3Chttp%3A%2F%2Fwww.filemaker.com%3E
Related function
TURL_ToURLEncoded |
Related topics
Troi URL Plug-in online help (overview)