Skip to content

fix(jni): a file name cut inside a character is repaired - #1470

Merged
andiwand merged 1 commit into
mainfrom
fix/jni-name-surrogate
Dec 4, 2026
Merged

andiwand merged 1 commit into
mainfrom
fix/jni-name-surrogate

Conversation

@andiwand

@andiwand andiwand commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

new File(path, name) in Java threw unpaired UTF-16 surrogate where the name holds half an emoji. Android providers can return such a name when they cut a long title.

The half is now replaced with U+FFFD in the name. The path still throws, since a changed character there could name another file. Two new JUnit tests cover both; the whole JUnit suite passes locally. I did not run the Android device tests.

Reported from OpenDocument.droid, which works around it in opendocument-app/OpenDocument.droid#791.

Android providers cut long names, sometimes inside a surrogate pair, and
`new File(path, name)` threw. A path stays strict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FW6WZXAWPwKbkkxah8iPGp
@andiwand
andiwand merged commit 8787326 into main Dec 4, 2026
23 checks passed
@andiwand
andiwand deleted the fix/jni-name-surrogate branch December 4, 2026 13:46
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.

1 participant