Shapefile Code Page — ISO-8859-1 Declaration
The sidecar that declares `attributes-cp1252.dbf` as ISO-8859-1. Note that the DBF also carries a language-driver byte in its header, and the two can disagree — which is exactly the ambiguity a reader has to resolve and document.
ISO-8859-1
Specifications
- Format
- Esri shapefile component
- Crs
- WGS 84 (EPSG:4326)
- Byte Order
- mixed — big-endian headers, little-endian records
- Sidecar Set
- .shp/.shx/.dbf/.prj/.cpg
- Content
- ISO-8859-1
- Line Endings
- LF
- Declares Encoding Of
- attributes-cp1252.dbf
- Language Driver Id In Dbf
- 0x03
Testing contract
Expected to pass- Scenario
- Resolve the DBF encoding when the .cpg sidecar and the header language-driver byte both carry information.
- Expected result
- The reader states which of the two it trusts. For the cp1252 pair they disagree, so a reader that silently picks one is making an undocumented choice.
What is a .cpg file?
A .cpg file is a one-line sidecar naming the character encoding used by a shapefile's .dbf attribute table — typically UTF-8, or a legacy code page such as ISO-8859-1 or CP1252. The dBase format has no reliable in-band encoding declaration, so without this file a reader has to guess, and non-ASCII attribute values come back as mojibake.
How to use this file
Use an example .cpg file to test shapefile readers' encoding handling, confirming that the declared code page is applied to .dbf string fields and that a missing or contradictory .cpg is reported rather than silently guessed.
How to use this file for testing
“Shapefile Code Page — ISO-8859-1 Declaration” is a deterministic Novus Examples fixture for Geospatial, Encoding detection, Metadata testing. GeoJSON, GPX, and KML files with points, lines, polygons, and tracks — for testing map tools, route parsers, and geo importers.
Documented properties for this file: LF · Esri shapefile component. 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.
Geospatial fixtures publish one invented territory across formats, with the coordinate reference system and feature counts documented in specs. Convert or reproject and diff against the twin in the same group; edge-case geometries state exactly which assumption they are built to break.
Related files
- cpgShapefile — Code Page Sidecar (.cpg, UTF-8)A one-line sidecar naming the encoding of the .dbf. Without it a reader has to guess — usually cp1252 — and every non-ASCII attribute value comes back as mojibake, which is the single most common shapefile data-loss bug.

- prjShapefile — Projection Sidecar (.prj, WGS 84)The one-line WKT that tells a reader what the .shp coordinates mean. Esri's flavour uses D_WGS_1984 and GCS_WGS_1984 rather than the OGC names and carries no EPSG authority code, so identifying it means matching the datum and spheroid rather than reading an ID.

- geojsonGeoJSON — bbox on Every FeatureThree features that each carry their own bbox. Spatial indexes are often built from these declared boxes instead of the geometry, so a wrong or stale one produces a query that silently misses features.

- geojsonGeoJSON — bbox on the FeatureCollectionThe five towns with a four-element bounding box on the collection, ordered west, south, east, north as RFC 7946 requires. The values are the true extent of the contained points, so a reader that recomputes the box can be scored against the declared one.

- geojsonGeoJSON — Foreign Members at Every LevelRFC 7946 section 6 allows members it does not define to sit alongside the ones it does, and requires parsers to ignore rather than reject them. This collection carries three such members at the top level.

- geojsonGeoJSON — Legacy 2008 `crs` Member (removed in RFC 7946)A FeatureCollection carrying the `crs` member from the 2008 GeoJSON specification. RFC 7946 removed it and fixed the CRS as WGS 84, so a modern reader should treat this as an ignorable foreign member — but plenty of exporters still write it and some readers still obey it.

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