Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GE P-file reader: adaptive character encoding #156

Merged
merged 5 commits into from
Nov 11, 2024

Conversation

alexcraven
Copy link
Contributor

ge_read_pfile and ge_pfile assumed utf-8 encoding in character strings within the p-file; this does not appear to be standard across systems. Suggested patch attempts a few likely encoding candidates, before falling back on a permissive ascii encoding.

After initial detection, subsequent conversions are more forgiving of an incorrect detection (substituting unknown characters, rather than crashing).

This bugfix allows us to also quantify data acquired from the right (høyre) side, and should also handle local patient names better.

`ge_read_pfile` and `ge_pfile` assumed utf-8 encoding in character strings within the p-file; this does not appear to be standard across systems. Suggested patch attempts a few likely encoding candidates, before falling back on a permissive ascii encoding.
@alexcraven
Copy link
Contributor Author

Test datasets available here; the first item (P30101.7) functions correctly before and after fix, remaining items (P3010[2-4].7) function only after the suggested fix.

GE_character_encoding_test_data.zip

@wtclarke wtclarke merged commit 8a9430e into wtclarke:master Nov 11, 2024
5 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