Skip to content
Novus Examples
diff263 B

Unified Diff - Octal-Quoted Non-ASCII Paths

With git's default `core.quotepath`, a path containing non-ASCII bytes is wrapped in double quotes and each byte is written as a backslash-octal escape. A parser that takes the header text literally creates a directory called `caf\303\251` on disk.

Preview — first 8 linesdiff
--- "a/docs/caf\303\251/gu\303\255a-de-usuario.md"	2026-03-02 09:14:03.000000000 +0000
+++ "b/docs/caf\303\251/gu\303\255a-de-usuario.md"	2026-03-02 10:41:55.000000000 +0000
@@ -1,3 +1,3 @@
 # Guía
 
-Instalación en cinco minutos.
+Instalación en dos minutos.

Specifications

Seed
20260807
Diff Format
unified
Files
1
Quote Path
true
Path
docs/café/guía-de-usuario.md
Line Endings
LF
Encoding
UTF-8

Testing contract

Expected to pass
Scenario
Extract the target path from a diff header that is double-quoted with octal byte escapes.
Expected result
The decoded path is docs/café/guía-de-usuario.md; the surrounding quotes are removed and each \\NNN escape becomes one UTF-8 byte.

What is a .diff file?

A .diff file records the difference between two versions of one or more text files. The unified format — the default almost everywhere — names the old and new files on `---` and `+++` lines, then lists hunks introduced by `@@ -old,count +new,count @@` in which context lines are unprefixed and changed lines are prefixed with `-` or `+`. Older context and normal diff formats exist but are rarely produced today.

How to use this file

Use an example .diff file to test diff parsers, syntax highlighters, and merge tooling — verifying hunk-offset arithmetic, correct handling of context lines that begin with a space, and behaviour on files whose changes include trailing-whitespace or line-ending differences.

How to use this file for testing

“Unified Diff - Octal-Quoted Non-ASCII Paths” is a deterministic Novus Examples fixture for Encoding detection, Visual diff / regression, Editor testing. UTF-8, UTF-8-BOM, UTF-16, and Latin-1 files with documented encodings and line endings for testing charset detection.

Documented properties for this file: seed 20260807 · UTF-8 · LF. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.

Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.

Diff and patch fixtures name their target paths and the exact edge case they exercise — rename, mode change, binary hunk, CRLF↔LF, or missing trailing newline. Apply or render them against the documented before-state; every author, path, and hash is fictional.

Generated by generation/version_control.py. Free for any use, no attribution required — license.