Skip to content

Fix charset detection returning literal None string on empty input - #2406

Closed
SpongeBob (As9xm) wants to merge 1 commit into
microsoft:mainfrom
As9xm:fix-charset-detection-none-result
Closed

Fix charset detection returning literal None string on empty input#2406
SpongeBob (As9xm) wants to merge 1 commit into
microsoft:mainfrom
As9xm:fix-charset-detection-none-result

Conversation

@As9xm

Copy link
Copy Markdown
Contributor

PlainTextConverter and CsvConverter did str(from_bytes(...).best()) without a None check, so when detection failed it returned the literal string "None" as document content.
This change checks for None and falls back to "" to avoid corrupting output.

@afourney

Copy link
Copy Markdown
Member

I believe this was addressed in #2384. Please re-open, if I am mistaken.

@afourney afourney closed this Sep 10, 2026
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