Convert Text Encoding
file.convert_encoding
Overview
You supply either a managed file reference or inline text and we convert between supported encodings (UTF-8, UTF-16LE/BE, ISO-8859-1, windows-1252, and others) with explicit BOM handling and a malformed-input policy. We return a new file reference when storage is available, or outputBase64 as a fallback. We refuse binary-looking input unless you set force. Do not use this for binary transcoding or content translation.
Encoding mistakes silently corrupt data. We make the conversion auditable with byte counts, BOM flags, and malformed-sequence tallies.
Reliability
Converted bytes are stable for the same input and options; the managed outputFileRef is newly allocated and varies between executions, while retrying is safe. Each input file is capped at 100 MiB. A fileRef resolves only inside your own tenant; once it has expired we can no longer read it and you get a validation error saying the reference is not accessible, so upload the file again and pass the new reference. Other validation errors are equally not worth retrying unchanged: sending both fileRef and content (or neither), UNSUPPORTED_FORMAT for an encoding outside the supported list, UNSAFE_INPUT when the bytes contain NUL and force is false, and PARSE_ERROR when onMalformedInput is error and a sequence is invalid — switch to onMalformedInput=replace if you would rather substitute than fail.
Context footprint
Returns outputFileRef or outputBase64 plus byte counts and BOM details. A successful call costs 5 execution credits.
When to use it
When you need to re-encode text files or inline content to a known charset.
For binary files, translation, or heuristic mojibake repair.
Scope
Non-goals
- Does not transcode binary formats
- Does not translate natural language content
- Does not repair mojibake heuristically
Properties
Capabilities
Cost & billing
Flat rate per invocation
File handling
File limits
Constraints this skill applies to your input and generated files. The “Limited by” column shows the static source of each cap; none of these can be raised by upgrading your plan.
| Limit | Value | Limited by |
|---|---|---|
| Maximum size per input file | 50 MiB | Platform maximum |
How we handle your data
What this means
This skill may temporarily store files or intermediate data only to complete execution. Temporary data is protected and automatically deleted.
Squillify guarantees
- Runs inside Squillify
- This skill runs inside Squillify.
- Payloads are not sent to an external service by this skill.
- Temporary execution only storage
- Squillify does not permanently store submitted payloads.
- Telemetry records metadata only, not submitted content.
- Submitted payloads are not used for training.
- Submitted payloads are not reviewed by humans.
- This skill does not target sensitive data.
- The response may contain submitted or transformed content.
Your responsibility
Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.
Input schema
| Field | Type | Required | Description |
|---|---|---|---|
| fileRef | string | No | Tenant-scoped managed text file capped at 100 MiB; required unless content supplies inline text. |
| content | string | No | Inline UTF-8 text capped at 100 MiB; required unless fileRef supplies managed content. |
| sourceEncoding | string | No | Case-insensitive supported source encoding or auto. |
| targetEncoding | string | No | Case-insensitive supported target encoding. |
| bomPolicy | string | No | Output byte-order-mark policy. |
| onMalformedInput | string | No | Whether malformed input fails or uses replacement characters. |
| force | boolean | No | Whether binary-looking NUL input may be processed. |
Output schema
| Field | Type | Required | Description |
|---|---|---|---|
| outputFileRef | string | No | New tenant-scoped managed reference when storage is available. |
| outputBase64 | string | No | Base64 bytes when managed storage is unavailable. |
| sourceEncodingDetected | string | Yes | Encoding used to decode input. |
| targetEncoding | string | Yes | Encoding used to encode output. |
| inputBytes | integer | Yes | Number of source bytes read before conversion. |
| outputBytes | integer | Yes | Output byte count, capped at 100 MiB. |
| malformedSequences | integer | Yes | Replacement-character count. |
| bom | object | Yes | Closed receipt object containing inputHadBom and outputHasBom boolean properties. |
| warnings | array | Yes | From 0 through 100 safe conversion advisory strings; currently empty on success. |
API contract
POST /v1/executecurl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"file.convert_encoding","input":{"content":"hello","targetEncoding":"UTF-8"}}'import { Squillify } from "@squillify/sdk";
const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });
const { output } = await sq.execute("file.convert_encoding", {"targetEncoding":"UTF-8","content":"café","sourceEncoding":"windows-1252"});Errors
| Code | HTTP | Retryable | Description |
|---|---|---|---|
| VALIDATION_ERROR | 400 | No | The request payload failed schema validation. |
| UNAUTHORIZED | 401 | No | Missing or invalid API key. |
| SKILL_NOT_ACCESSIBLE | 403 | No | The API key is not granted access to this skill. |
| SKILL_NOT_AVAILABLE_FOR_PLAN | 403 | No | This skill is not included in your current plan. |
| PLAN_ELIGIBILITY_UNAVAILABLE | 503 | Yes | Plan eligibility could not be decided. Retry after backoff. |
| SKILL_NOT_FOUND | 404 | No | The requested skill or version does not exist. |
| TENANT_RATE_LIMITED | 429 | Yes | Request rate limit exceeded. Retry after backoff. |
| QUOTA_EXCEEDED | 429 | Yes | Plan quota exhausted. Retryable once the quota period resets. |
| EXECUTION_TIMEOUT | 504 | Yes | Execution exceeded the allowed time budget. |
Other limits
| Limit | Value |
|---|---|
| Recommended inline bytes | 32 KiB |
Limitations
- Does not transcode binary formats
- Does not translate natural language content
- Does not repair mojibake heuristically
- Binary files such as images or PDFs
- Content translation between languages
How to call
POST /v1/execute (requires authentication)
{
"skillKey": "file.convert_encoding",
"input": {
"targetEncoding": "UTF-8",
"content": "café",
"sourceEncoding": "windows-1252"
}
}Examples
Force inline bytes to be read as windows-1252
{
"targetEncoding": "UTF-8",
"content": "café",
"sourceEncoding": "windows-1252"
}{
"warnings": [],
"outputBytes": 7,
"sourceEncodingDetected": "windows-1252",
"inputBytes": 5,
"bom": {
"inputHadBom": false,
"outputHasBom": false
},
"targetEncoding": "UTF-8",
"outputFileRef": "squillify://files/f-generated-converted-text",
"malformedSequences": 0
}UTF-8 inline text to UTF-16LE with BOM added
{
"targetEncoding": "UTF-16LE",
"bomPolicy": "add",
"content": "hello"
}{
"warnings": [],
"outputBytes": 12,
"sourceEncodingDetected": "UTF-8",
"inputBytes": 5,
"bom": {
"inputHadBom": false,
"outputHasBom": true
},
"targetEncoding": "UTF-16LE",
"outputFileRef": "squillify://files/f-generated-converted-text",
"malformedSequences": 0
}Recommended use cases
- Normalize legacy Windows-1252 exports to UTF-8
- Fix encoding before CSV or log import
Avoid for
- Binary files such as images or PDFs
- Content translation between languages
Related skills
Composable with
Safety & privacy
- Runs without calling any external service.
- Your payloads are never stored permanently.
- Telemetry captures metadata only — never your payload contents.
- We never train models on your payloads.
- No human reviews your payloads.