Skip to main content

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

MicroSkills Reference

Detect Text Encoding

file.detect_text_encoding

ProductionEngine wrapper (Class A)Deterministicstrictfastv1.0.0
File inputNo network

Overview

You send a binary file_ref up to 5 MiB. We inspect a 1 KiB–1 MiB sample (256 KiB unless you set sampleBytes), report a BOM when present, and return ranked ICU candidates from a closed allowlist. Confidence is advisory: ASCII-only input never claims certainty. This does not decode the file or expose arbitrary JVM charsets.

Guessing a charset from a filename or a platform default silently mojibakes later decode steps.

Reliability

ICU confidence is advisory. ASCII-only input is flagged and capped. ITEM_LIMIT_EXCEEDED — trigger: the file exceeds 5 MiB; retryable: no; next: sample a smaller artifact.

Context footprint

BOM, candidates, binaryLikely, sampledBytes, asciiOnly. A successful call costs 1 execution credit.

When to use it

When a managed file's encoding is unknown and you need an advisory candidate list plus BOM.

When you already know the encoding, or you need the decoded text in this call.

Powered by ICU4J charset detection (com.ibm.icu:icu4j).

Scope

Note
Estimates text encoding of a bounded file sample using a per-call ICU CharsetDetector.

Non-goals

  • Does not decode or convert the file
  • Does not guarantee language identification
  • Does not expose arbitrary JVM charset names

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisencodingparsing

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MBMax file size5 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 file5 MiBSkill and platform maximum
Maximum total input size5 MiBSkill maximum
Maximum number of input files1Skill 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
file_refstringYesTenant-scoped binary file up to 5 MiB whose encoding is estimated from a bounded sample.
sampleBytesintegerNoPrefix length in bytes, 1024 through 1048576. Omit it for 262144.
allowlistarrayNoOptional filter of 1 through 14 published encoding names; omit it to keep the full allowlist.

Output schema

FieldTypeRequiredDescription
bomstringNoCanonical BOM encoding when a BOM is present; omit this field when the sample has no BOM.
candidatesarrayYesFrom 0 through 14 ranked candidates; empty when the sample is binary-likely without a BOM.
binaryLikelybooleanYesTrue when the inspected prefix is NUL-heavy or control-heavy enough to look binary.
sampledBytesintegerYesHow many prefix bytes were handed to ICU, at most sampleBytes and the file size.
asciiOnlybooleanYesTrue when every sampled byte is 7-bit and no BOM is present; confidence is then capped.

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.detect_text_encoding","input":{"file_ref":"squillify://files/f-utf8-bom"}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("file.detect_text_encoding", {"file_ref":"squillify://files/f-utf8-bom"});

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.
ITEM_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not decode or convert the file
  • Does not guarantee language identification
  • Does not expose arbitrary JVM charset names
  • Treating the top candidate as certain on ASCII
  • Decoding the payload in the same call

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "file.detect_text_encoding",
  "input": {
    "file_ref": "squillify://files/f-utf8-bom"
  }
}

Examples

UTF-8 BOM is reported

Inputjson
{
  "file_ref": "squillify://files/f-utf8-bom"
}
Expected outputjson
{
  "binaryLikely": false,
  "sampledBytes": 5,
  "bom": "UTF-8",
  "asciiOnly": false,
  "candidates": []
}
Tip
EF BB BF plus hi is reported as a UTF-8 BOM

ASCII does not claim certainty

Inputjson
{
  "file_ref": "squillify://files/f-ascii"
}
Expected outputjson
{
  "binaryLikely": false,
  "asciiOnly": true,
  "candidates": [],
  "sampledBytes": 5
}
Tip
ASCII-only samples set asciiOnly and never treat confidence as certainty
  • Choose an encoding before file.convert_encoding
  • Flag NUL-heavy uploads as binaryLikely

Avoid for

  • Treating the top candidate as certain on ASCII
  • Decoding the payload in the same call

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

charsetencodingfile