Repository navigation
fix: enforce deterministic CSV whitespace rules - #138
Merged
mehulimukherjee merged 1 commit intoNov 30, 2026
Merged
Conversation
mehulimukherjee
approved these changes
Nov 30, 2026
Member
|
Hi @lyn1dev , Thank you for your contribution, much appreciated, if you liked working on this project, could you please STAR the repo as well for more reach? Thanks 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #16 by enforcing deterministic cell whitespace normalization in
CsvExporter(and thereforeTable#toCSV(char), CLI, service, and batch callers):\h+, including spaces, tabs, and Unicode space separators such as NBSP\u00A0) to a single ASCII space (' ').\nor\rexplicitly instead of checking onlySystem.lineSeparator(), ensuring embedded LF/CR cells are quoted consistently across Windows, macOS, and Linux.extractpdf4j-core/src/test/resources/csv-whitespace-golden.csv) verified acrossLocale.US,Locale.GERMANY, andLocale.JAPAN.Testing & Validation
Unit tests added
Integration test added
Manual verification performed
Benchmark results included (if performance-related)
The 3 new tests in
CsvExporterTestfail before the fix (missing whitespace normalization, unquoted\ncell on Windows) and pass after the fix (mvn -B -pl extractpdf4j-core -Dtest=CsvExporterTest,TableTest test: 11 tests run, 0 failures).Full reactor verification (
mvn -B verify --file pom.xml) passes across all 6 modules (extractpdf4j-core,extractpdf4j-cli,extractpdf4j-service,extractpdf4j-example-batch-folder), with 3 assumption-skipped OCR tests incom.extractpdf4j.helpers.OcrTestwhere the localtesseractbinary is absent.Impact
Eliminates whitespace-only diffs in generated CSV output across operating systems, locales, and JDKs without altering raw
Tablecell accessors orJsonExporter.