Skip to content

decode IPC responses with non-UTF-8 bytes - #395

Merged
yavko merged 1 commit into
hyprland-community:masterfrom
romanstingler:fix/non-utf8-window-titles
Jun 12, 2026
Merged

yavko merged 1 commit into
hyprland-community:masterfrom
romanstingler:fix/non-utf8-window-titles

Conversation

@romanstingler

Copy link
Copy Markdown
Contributor

Hyprland stores window titles verbatim. Clients like OnlyOffice and
Java/Swing apps (Jubler) may set the title with non-UTF-8 bytes (raw
filename bytes in the JVM's default charset or Latin-1), which produced
tradu��ocoletiva.docx instead of traduçãocoletiva.docx in downstream
tools that decoded the response with String::from_utf8_lossy.

Replace the lossy UTF-8 decode in Instance::write_to_socket[_async]
(and the hyprpaper variants) with a content-based encoding detector
(chardetng + encoding_rs). Valid UTF-8 still passes through untouched;
ambiguous bytes fall back to lossy (no regression vs. before).

Related to MalpenZibo/ashell#577

@yavko
yavko merged commit 84f49da into hyprland-community:master Jun 12, 2026
1 check passed
@romanstingler
romanstingler deleted the fix/non-utf8-window-titles branch July 25, 2026 18:25
@Mirilindo Mirilindo mentioned this pull request Sep 9, 2026
2 tasks done
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