Actions22
- Tool Actions
- Other Tool Actions
- Date Operation Actions
- Text & Formatting Actions
Text & Formatting → Encode String
AI-generatedOverview
The node "Ido Toolbox" provides a variety of text and data manipulation tools, including an operation to URL-encode strings. The Encode String operation under the Text & Formatting resource specifically takes an input string and returns its URL-encoded form. This is useful when you need to safely encode Hebrew or any other text for use in URLs, ensuring special characters are properly escaped.
Common scenarios include:
- Preparing query parameters for HTTP requests.
- Encoding user input before sending it to web APIs.
- Safely embedding Hebrew or other non-ASCII text in URLs.
Example:
Input: שלום עולם
Output: %D7%A9%D7%9C%D7%95%D7%9D%20%D7%A2%D7%95%D7%9C%D7%9D
Properties
| Name | Meaning |
|---|---|
| Input String | The string to URL-encode. |
Note: For this operation, only one property is relevant — the string that will be encoded.
Output
The output JSON object contains:
| Field | Description |
|---|---|
| originalString | The original input string before encoding. |
| encodedString | The URL-encoded version of the input string. |
| encodingType | The type of encoding applied (always "URL"). |
No binary data is produced by this operation.
Example output JSON:
{
"originalString": "שלום עולם",
"encodedString": "%D7%A9%D7%9C%D7%95%D7%9D%20%D7%A2%D7%95%D7%9C%D7%9D",
"encodingType": "URL"
}
Dependencies
- No external services or API keys are required.
- The operation uses JavaScript's built-in
encodeURIComponentfunction for encoding. - No special environment variables or n8n credentials are needed.
Troubleshooting
Error: "Failed to encode string"
This error occurs if the input string cannot be processed byencodeURIComponent. Usually, this happens with invalid or malformed input. Ensure the input is a valid string.If the output encoded string is identical to the input, it means no encoding was necessary (e.g., the string contained only URL-safe characters).
Make sure the input string is not empty; otherwise, the output will also be empty.
Links and References
- MDN Web Docs: encodeURIComponent() - Explanation of the encoding function used internally.
- URL Encoding - General information about URL encoding and percent-encoding.