Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Convert Text Encoding

file.convert_encoding

ProductionBounded custom (Class B)verifiablefastv1.0.0
File inputFile outputNo networkTemp storage

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

Note
Converts text content or a managed file between character encodings.

Non-goals

  • Does not transcode binary formats
  • Does not translate natural language content
  • Does not repair mojibake heuristically

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

encoding

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call5 credits

File handling

Accepts file_refProduces file_refMax input100 MBMax file size100 MB

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.

LimitValueLimited by
Maximum size per input file50 MiBPlatform maximum

How we handle your data

Protected temp storage
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.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
fileRefstringNoTenant-scoped managed text file capped at 100 MiB; required unless content supplies inline text.
contentstringNoInline UTF-8 text capped at 100 MiB; required unless fileRef supplies managed content.
sourceEncodingstringNoCase-insensitive supported source encoding or auto.
targetEncodingstringNoCase-insensitive supported target encoding.
bomPolicystringNoOutput byte-order-mark policy.
onMalformedInputstringNoWhether malformed input fails or uses replacement characters.
forcebooleanNoWhether binary-looking NUL input may be processed.

Output schema

FieldTypeRequiredDescription
outputFileRefstringNoNew tenant-scoped managed reference when storage is available.
outputBase64stringNoBase64 bytes when managed storage is unavailable.
sourceEncodingDetectedstringYesEncoding used to decode input.
targetEncodingstringYesEncoding used to encode output.
inputBytesintegerYesNumber of source bytes read before conversion.
outputBytesintegerYesOutput byte count, capped at 100 MiB.
malformedSequencesintegerYesReplacement-character count.
bomobjectYesClosed receipt object containing inputHadBom and outputHasBom boolean properties.
warningsarrayYesFrom 0 through 100 safe conversion advisory strings; currently empty on success.

API contract

POST /v1/execute
curl
curl -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"}}'
Integrations
TypeScript SDK
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

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.

Other limits

LimitValue
Recommended inline bytes32 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)

Request bodyjson
{
  "skillKey": "file.convert_encoding",
  "input": {
    "targetEncoding": "UTF-8",
    "content": "café",
    "sourceEncoding": "windows-1252"
  }
}

Examples

Force inline bytes to be read as windows-1252

Inputjson
{
  "targetEncoding": "UTF-8",
  "content": "café",
  "sourceEncoding": "windows-1252"
}
Expected outputjson
{
  "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
}
Tip
Inline content always arrives as UTF-8 bytes, so naming a different sourceEncoding reinterprets those bytes: the five bytes of "café" get decoded as windows-1252 and come back as the seven bytes of "café". Reach for sourceEncoding on a fileRef, where the stored bytes really are in that legacy charset; leave it out for inline text you already hold as text.

UTF-8 inline text to UTF-16LE with BOM added

Inputjson
{
  "targetEncoding": "UTF-16LE",
  "bomPolicy": "add",
  "content": "hello"
}
Expected outputjson
{
  "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
}
  • 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

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.

Tags

textencodingfile