Source: https://guthlabs.ai/docs/instruments/character-encoding-converter-utf-8-16-32-latin-1/

instrument / verified-clean

# Character Encoding Converter (UTF-8/16/32, Latin-1)

The current ledger marks this instrument verified clean within the source-bound verification corpus.

Status: **VERIFIED_CLEAN**Lifecycle: **verified-clean**

## Inspectable records

[01**Overview**Purpose and lifecycle](<https://guthlabs.ai/docs/instruments/character-encoding-converter-utf-8-16-32-latin-1/>)[02**Mechanism**Method and assumptions](<https://guthlabs.ai/docs/instruments/character-encoding-converter-utf-8-16-32-latin-1/mechanism/>)[03**Implementation**Binding and validation](<https://guthlabs.ai/docs/instruments/character-encoding-converter-utf-8-16-32-latin-1/implementation/>)[04**Qualification**Evidence and errata](<https://guthlabs.ai/docs/instruments/character-encoding-converter-utf-8-16-32-latin-1/qualification/>)

## Ledger state

The current ledger marks this instrument verified clean within the source-bound verification corpus.

**Area**: Computing & Information

**Tranche**: tranche-5

**Evidence ID**: t5-142

**Ledger rows**: 1

No ledger note is attached.

## Review findings

The spec must explicitly define UTF-16/UTF-32 endianness, BOM policy, malformed-input behavior, Latin-1 versus Windows-1252, replacement policy, and the algorithm or limitations for mojibake-risk detection. The empty honest_label is a concern: the instrument should state these limitations rather than imply that encoding conversion can reliably detect mojibake.

### Formula and scope findings

- The formula description is incomplete: byte-length rules alone do not define encoding conversion, decoding, malformed-sequence handling, or replacement behavior.

- UTF-16 and UTF-32 require an explicit endianness and BOM policy; the spec only names UTF-16 and UTF-32.

- UTF-8 validity must reject overlong encodings, surrogate code points, code points above U+10FFFF, invalid continuation bytes, and truncated sequences.

- UTF-16 validity must reject unpaired surrogates and define whether a BOM is accepted, required, emitted, or counted.

- Latin-1 is ISO-8859-1 only if explicitly distinguished from Windows-1252; characters above U+00FF are unmappable and require a defined error policy.

- Mojibake risk has no stated computable formula; arbitrary text cannot reliably be classified as mojibake from encoding metadata alone.

### Unit assumptions

- All byte lengths are counts of octets (8-bit bytes), not character counts or UTF-16 code-unit counts.

- UTF-16LE and UTF-32LE are used in the test vectors; no BOM is emitted or counted.

- UTF-8 uses the standard scalar-value ranges: U+0000-U+007F uses 1 byte, U+0080-U+07FF uses 2, U+0800-U+D7FF and U+E000-U+FFFF use 3, and U+10000-U+10FFFF uses 4.

- UTF-16LE uses 2 bytes for each non-surrogate BMP scalar and 4 bytes for each supplementary scalar represented by a surrogate pair.

- UTF-32LE uses 4 bytes for each valid Unicode scalar value.

- Latin-1 means ISO-8859-1, mapping U+0000-U+00FF to one byte; it does not mean Windows-1252.

## Boundary hardening

**BREAK_CLAIMED** · SELF_FLAGGED

The specification does not define UTF-16 endianness or how BOM-less UTF-16 input is interpreted. The bytes 00 41 validly decode as U+4100 under UTF-16LE or U+0041 under UTF-16BE, producing different UTF-8 outputs.

## Errata and corrections

No applied erratum is attached to this unique-name record.

## Inspectable example

4 review vectors are recorded. One source-bound sample is shown below.

````
{
  "inputs": {
    "text": "Cat",
    "source_encoding": "Unicode text",
    "target_encoding": "UTF-16LE"
  },
  "expected_outputs": {
    "utf8_bytes_hex": "43 61 74",
    "utf8_byte_length": 3,
    "utf16le_bytes_hex": "43 00 61 00 74 00",
    "utf16le_byte_length": 6,
    "utf32le_bytes_hex": "43 00 00 00 61 00 00 00 74 00 00 00",
    "utf32le_byte_length": 12,
    "latin1_bytes_hex": "43 61 74",
    "latin1_byte_length": 3,
    "target_bytes_hex": "43 00 61 00 74 00",
    "invalid_sequence_warnings": []
  },
  "working": "U+0043, U+0061, and U+0074 are each in U+0000-U+007F, so UTF-8 length = 1+1+1 = 3 bytes. Each is a BMP scalar, so UTF-16LE length = 2+2+2 = 6 bytes. UTF-32LE length = 4+4+4 = 12 bytes. All three code points are <= U+00FF, so Latin-1 length = 1+1+1 = 3 bytes. UTF-16LE encoding is U+0043 -> 43 00, U+0061 -> 61 00, U+0074 -> 74 00."
}
````

## Related workflows

No source-defined multi-instrument workflow membership is recorded.

## Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

- `VERIFIED_LEDGER.json · VERIFIED_CLEAN`

- `evidence-tranche5/tranche5-results.json`

- `BOUNDARY_HAZARD_CATALOG.json`
