Text Editor Encoding: Fix Unrepresentable Characters Before Saving

An unrepresentable character is an editorial question before it is an encoding question. Identify what the character means in context, approve whether it should remain, change, or be removed, and only then choose a file encoding that can carry the decision. Reaching zero warnings by automatic deletion can produce a technically writable but incorrect manuscript.

This text editor encoding unrepresentable characters workflow separates four editorial decisions from the mechanical save. A controlled set of three encoded sources and a separately named UTF-8 copy supplies measured values, while interface warnings documented by Rune Studio remain outside the command-run observations.

Triage four kinds of character decisions

A personal-name variant may be essential and must not be normalized without approval. A historic form may need to remain with an explanation. A decorative symbol may be removable if it has no textual role. An intentional mark may require an agreed substitute for the distribution format.

Give each candidate a row containing the original character, surrounding sentence, intended meaning, approved representation, and target encoding. The editorial acceptance condition is that every row has a reason. It is not simply that a counter reaches zero.

Graphical highlighting can help locate rows, but color does not decide their meaning. The same warning mechanism may flag a dispensable ornament and an indispensable name. The editor owns the distinction.

Avoid a universal “replace with question mark” rule. That removes the visible problem while making restoration harder. When meaning is unknown, preserve the source and escalate the decision instead of saving.

Freeze approved text before selecting the target encoding

The controlled sources were inspected as UTF-8/LF/44 characters, Shift_JIS/LF/44 characters, and UTF-16LE/LF/45 characters. They held the same short Japanese sample in different representations. The measured counts describe those files, not a normal count for all manuscripts.

After the four hypothetical decisions were resolved, the approved text was stored as approved-utf8-content.txt, SHA-256 6244b7850324ea7565a8ef0162441e40ce505a4c5b429cf4d3decd99713c2424. That file is the semantic authority for the save test.

The distinction matters because a target encoding can be mechanically valid for the wrong wording. First approve the Unicode string. Then check whether the chosen encoding represents it. If a required delivery format cannot represent an approved character, return to the editorial row and choose an authorized alternative or a different format.

No application should silently make that choice. File inspection and warning detection provide facts; authors and editors authorize words.

Choose a new filename and preflight the write

The output was named STUDIO-306-converted-copy.txt. The recorded preflight command was rune file write --path /private/tmp/rune-g2c3-studio-306-38st8g2a/STUDIO-306-converted-copy.txt --content-file /private/tmp/rune-g2c3-studio-306-38st8g2a/approved-utf8-content.txt --dry-run --json.

The command names the approved content as input and a new file as output. None of the UTF-8, Shift_JIS, or UTF-16LE source paths is the target. That is the rollback design: the original evidence remains intact regardless of the write outcome.

After preflight, the run removed only the --dry-run flag and executed the write. Both commands exited with code 0. A successful response creates an output candidate; it does not yet certify the encoded text.

If Shift_JIS is a required delivery format, run a separate representability check for the approved characters. Do not assume that UTF-8's capacity proves another encoding can carry the same string.

Return from the saved file to the decision record

The output was reopened with rune inspect text --file /private/tmp/rune-g2c3-studio-306-38st8g2a/STUDIO-306-converted-copy.txt --json. It reported UTF-8, LF, and 44 characters.

Its checksum matched the approved text: 6244b7850324ea7565a8ef0162441e40ce505a4c5b429cf4d3decd99713c2424. The decoded strings also compared equal. These observations prove that the approved decision record survived this separate-file save.

Count is only one field. A different 44-character string would fail. The acceptance card therefore requires target encoding, line ending, checksum or decoded-text equality, and the approved character decisions.

If the readback fails, preserve the unsuccessful output. Compare the decision rows, approved-content file, write input, and destination in that order. Generate a newly named attempt after locating the discrepancy instead of overwriting the source.

That recovery order prevents a file operation from reopening editorial decisions that already passed, and it prevents an editorial correction from being blamed on the storage command.

Keep interface documentation outside the measured result

Rune Studio's public documentation describes major Japanese encoding detection, red graphical marking of unrepresentable characters, and stopping automatic save while unresolved characters remain. The controlled CLI run measured encoding inspection, dry run, separate-file write, and readback. It did not measure red pixels, autosave timing, IME input, or selection state.

This workflow also does not perform OCR, binary repair, or complete recovery of an overwritten source. It applies while a readable authority and contextual editorial decisions are still available.

The decision sheet should keep four columns beside every suspect character: surrounding context, approved representation, authority consulted, and the output checksum that contains the decision. A person's name may require the author's manuscript as authority, while a punctuation substitution may depend on the publishing specification. Clearing an error without filling the authority column is a failed review, because the file may be writable yet semantically wrong.

When a candidate was chosen incorrectly, return to the untouched authority and create another separately named output. Do not overwrite the source or quietly replace the failed copy. Repeating preflight, write, and decoded readback produces a reviewable correction trail and leaves a practical rollback point.

Rune Studio can make detection and file handling available in one Mac editing environment, but it cannot determine the intended spelling of a name. Review the current Rune Studio feature scope. Accept the save when meaning, approved representation, separate output, and decoded readback all agree—not merely when the warning count disappears.