Skip to main content

TURL_ToHTTP (function reference)

By October 1, 2021October 13th, 2021Online Help, Troi URL plug-in
Troi URL Plug-in for FileMaker Pro

TURL_ToHTTP

Encodes a text in HTTP.

SyntaxFunction badge

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 functionFunction badge

TURL_ToURLEncoded

Related topics

Troi URL Plug-in online help (overview)


Online Help Page for Troi URL Plug-in for 16 to 19 –> TURL_ToHTTP (urlp4407) 2021-1013 16:38:26