Skip to content

Fix iconv error on CSV export with special characters (RES-2058)#828

Merged
edwh merged 4 commits intodevelopfrom
RES-2058_dash_export_problem
Apr 23, 2026
Merged

Fix iconv error on CSV export with special characters (RES-2058)#828
edwh merged 4 commits intodevelopfrom
RES-2058_dash_export_problem

Conversation

@edwh
Copy link
Copy Markdown
Collaborator

@edwh edwh commented Jan 23, 2026

Summary

  • Add //IGNORE flag to all iconv calls using //TRANSLIT in ExportController
  • This prevents "Detected an illegal character in input string" errors on servers with older glibc (2.27) and POSIX locale
  • Add test for CSV export with special characters (emdash, accented characters)

Problem

The network event export was failing on production with:

iconv(): Detected an illegal character in input string

We think this occurred when exporting events for a network containing a group with an emdash (—) in the name. But we can't reproduce the actual problem.

Solution

Nevertheless there is a likely fix to change all iconv('UTF-8', 'ASCII//TRANSLIT', ...) calls to iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', ...). The //IGNORE flag tells iconv to skip characters that cannot be transliterated rather than throwing an error.

Add //IGNORE flag to all iconv calls using //TRANSLIT in ExportController.
This prevents "Detected an illegal character in input string" errors on
servers with older glibc (2.27) and POSIX locale, which lack transliteration
tables for certain Unicode characters like emdash (—).

The error was triggered when exporting events for a network containing a
group with special characters in the name. The fix ensures untransliterable
characters are skipped rather than causing an error.

Note: The test documents this issue but cannot reproduce the actual error
because the Docker test environment uses glibc 2.41 which has better
transliteration support than the production server's glibc 2.27.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@edwh edwh force-pushed the RES-2058_dash_export_problem branch from 34f74c3 to 20b4913 Compare February 2, 2026 22:35
Comment thread .circleci/config.yml Fixed
Comment thread .circleci/config.yml Fixed
Comment thread .circleci/config.yml Fixed
Comment thread Taskfile.yml Fixed
…r/fr-BE tag translations

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@edwh edwh force-pushed the RES-2058_dash_export_problem branch from 6df8b6e to 759e106 Compare February 24, 2026 15:10
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
15 Security Hotspots
7.9% Duplication on New Code (required ≤ 3%)
E Security Rating on New Code (required ≥ A)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

edwh added 2 commits April 23, 2026 22:47
Local working tree had CRLF files that don't match the .gitattributes
eol=lf rule. Commit the normalization before merging develop.
Brings in Laravel 10 + group tags. Conflict resolutions:
- lang/fr/networks.php and lang/fr-BE/networks.php: HEAD side added a
  duplicate description_placeholder key (already defined earlier in the
  same array); took develop's version which doesn't duplicate.
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
18.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@edwh edwh merged commit 7dc4e70 into develop Apr 23, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants