Skip to content

fix(window): decode macOS window titles as UTF-8 - #1834

Open
sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/macos-window-title-utf8
Open

sebastian-griego wants to merge 1 commit into
bendlang:mainfrom
sebastian-griego:fix/macos-window-title-utf8

Conversation

@sebastian-griego

Copy link
Copy Markdown
Contributor

Window.open decodes UTF-8 title bytes as Latin-1 on macOS. For example, café becomes café. Use stringWithUTF8String: to read the bytes from io_cstr, consistent with Window.set_title.

Add a regression that reads the actual native window title and closes each window. It checks Unicode (Bend café 日本語 😀), ASCII, and empty titles. A run without a display accepts only ENOTSUP; other open errors fail the test.

Validation on macOS, based on current main aee1b1f2:

  • The same native regression prints False / True / True with the old decoder and True / True / True with the fix. These runs used a display and inspected the actual titles.
  • The interpreter and generated JavaScript under Bun print True / True / True. These runs check the ENOTSUP path because the JavaScript backend has no display.
  • gates/repo.ts: PASS: 54 / 54.
  • git diff --check: passed.

The full cluster gates and Linux native test were not run.

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