AppyDev Blog
Find the hidden character behind a text mismatch with PUNIPO Text Lens
Use five reproducible Unicode examples to spot hidden spaces and combining marks, then report the code point and UTF-16 offset.
Disclosure: This walkthrough was prepared by OpenAI Codex on behalf of kanitabetakunai, who operates PUNIPO and publishes the separate Little Tools collection. Codex also assisted in creating the tool. This is a first-party tutorial. The examples were checked in the browser interface.
Two short strings can look the same and still fail an exact comparison. A copied label may contain a non-breaking space instead of an ordinary space. A word may contain an invisible separator. An accented letter may consist of a base letter followed by a combining mark. Retyping everything sometimes makes the symptom disappear, but it also destroys the evidence that could explain the mismatch.
This walkthrough has one goal: turn a confusing visual mismatch into a small, reproducible report identifying the actual characters. It uses the browser version of PUNIPO Text Lens. The tool inspects text without normalizing, removing or rewriting it. You do not need the command-line companion or a software installation for this exercise.
Start with a harmless, reproducible sample
Open Text Lens and locate the text input and Inspect text button. Use the short examples below instead of a production password, customer record or private message. Even a useful diagnostic report can expose the text it describes when someone copies it into a public issue.
The following JavaScript defines five exact sample values. In a JavaScript environment you already use, evaluate the value you want, then copy that resulting string as text, without the surrounding display quotes, into Text Lens. The escapes are there to make the invisible characters unambiguous in the article:
const examples = {
ordinarySpace: "A B",
nonBreakingSpace: "A\u00A0B",
zeroWidthSpace: "A\u200BB",
combiningAccent: "Cafe\u0301",
precomposedAccent: "Caf\u00E9"
};
examples.nonBreakingSpace
Do not paste the literal characters \u00A0 into Text Lens and expect it to decode them. The inspector examines the text it receives. A backslash, a letter and four digits are a different input from one non-breaking space. If a clipboard or editor changes the sample, the resulting code-point list will reveal that too.
Paste one value at a time and choose Inspect text after each change. The earlier result becomes stale when the input changes, so make the new inspection before comparing numbers. For these examples, the most useful parts of the result are the code-point column, the UTF-16 offset and the displayed label for unusual characters.
Establish the ordinary-space baseline
Begin with examples.ordinarySpace, which contains the letter A, an ordinary space and the letter B. The result should contain three code points and three UTF-16 units. Its sequence is:
U+0041 U+0020 U+0042
The middle row identifies SPACE, at zero-based UTF-16 offset 1. That offset describes the position in the input, not a screen coordinate. Keep this result as the reference for the next sample. Merely counting three characters would not identify which kind of space is present; the code-point value does.
Compare a non-breaking space
Replace the input with examples.nonBreakingSpace and inspect it. The counts remain three code points and three UTF-16 units. The meaningful difference is the middle row: U+00A0, labelled NBSP, replaces U+0020. Its offset is still 1.
A non-breaking space can look like the ordinary space beside it. It is a distinct character, so an exact string comparison can distinguish the two values even when the rendered labels look alike. This inspection does not prove that whitespace caused your application's bug; it gives you a specific difference to test against that application's comparison and input rules.
At this point, a useful report is already possible: “The expected label uses U+0020 at offset 1; the copied label uses U+00A0 at that offset.” That is easier to reproduce than “the spaces look weird.” Avoid changing all whitespace in the application before deciding whether non-breaking spaces are valid in that field.
Find a zero-width character
Now inspect examples.zeroWidthSpace. It may look like AB, but the result contains three code points:
U+0041 U+200B U+0042
The middle row is labelled ZWSP. It occupies UTF-16 offset 1 even though it does not appear as an ordinary visible letter or gap. Looking only at a screenshot of the string would make that extra code point easy to miss.
This is a reason to retain a code-point sequence in a bug report, not a reason to delete every zero-width character in every language. Text systems use characters that do not look like separate printed letters. Text Lens makes selected characters visible for inspection; it does not decide which characters your application should accept, preserve or reject.
Separate an accented appearance from its representation
Inspect examples.combiningAccent, then examples.precomposedAccent. Both may render as Café. In the first value, the end of the string is U+0065 followed by U+0301, a combining acute accent. In the second, the end is the single code point U+00E9.
The combining form has five code points and five UTF-16 units. The precomposed form has four of each. Text Lens reported four grapheme clusters for both forms in the browser used to check this walkthrough. The combined visual letter is therefore a useful example of why a code-point count and a grapheme count answer different questions.
Text Lens uses the browser's Intl.Segmenter when available for the grapheme count. That value is not a measurement of rendered width. The code-point rows remain useful if a browser cannot provide grapheme segmentation.
JavaScript also offers String.prototype.normalize() for Unicode normalization. Whether and where normalization belongs is an application decision. Text Lens does not apply it to the input, so the two representations stay distinguishable during this inspection.
Turn the observation into a minimal report
These results came from running each sample through Inspect text. The tool preserved the original input in all five cases.
| Sample | Code points | UTF-16 units | Graphemes in the checked browser | Distinguishing code point |
|---|---|---|---|---|
| Ordinary space | 3 | 3 | 3 | U+0020 at offset 1 |
| Non-breaking space | 3 | 3 | 3 | U+00A0 at offset 1 |
| Zero-width space | 3 | 3 | 3 | U+200B at offset 1 |
| Combining accent | 5 | 5 | 4 | U+0301 at offset 4 |
| Precomposed accent | 4 | 4 | 4 | U+00E9 at offset 3 |
Use the copy control if you want the inspection report, or transcribe only the relevant rows. Review it before sharing. Selected control and formatting characters are labelled in the readable report; the surrounding text can still be sensitive.
A compact issue report could contain the sample as an escaped JavaScript string, the expected and observed code-point sequences, the affected offset, and the application's expected behavior. For example: “"A\u00A0B" is rejected where "A B" is accepted; both are three UTF-16 units, and only the middle code point differs.” Add the browser and application version relevant to your own reproduction. Keep a minimal sample rather than attaching an entire document.
Know what this inspection does not establish
The input limit is 10,000 UTF-16 units. Those units are not a byte count, and these five short examples do not exercise every Unicode sequence. The tool includes selected labels for spaces, controls and combining marks; it is not a complete database of official Unicode character names, a visual-confusables security scanner, or a validator for every language and file format. A clean-looking inspection does not certify that a string is safe or that two values should be treated as equivalent.
The diagnostic code processes the supplied text in the browser and does not upload it. That statement concerns the tool's code, not a guarantee that its hosting provider makes no ordinary web requests or retains no access information. For implementation details, the fixed text.js source and MIT notice are available for review.
The practical result is a precise observation you can take back to the application: which code point differs, where it occurs, and how to reproduce it. Decide on a fix only after that evidence is clear.
Questions or corrections about the tool: contact@punipo.com.