Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug]: WebKit decodes HTML from route.fulfill() as windows-1252, ignoring charset=utf-8

オープン
#43,649 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript
領域
backend

調査の方向性

Start by tracing how WebKit handles responses created by route.fulfill() and how it sets response headers and encodes the body; compare that path with the real HTTP response behavior described here. The payload does not name source files or tests, so locate the relevant WebKit route fulfillment code and its tests. Done when the fulfilled HTML reports UTF-8 and preserves ₹, matching Chromium, Firefox, and WebKit's real server response.

索引モデルが issue の本文から書いたものです。

説明

browser-webkit
Version

1.64.1 (also 1.58.2 and 1.65.0-alpha-2026-10-26)

Steps to reproduce

In an empty directory on Ubuntu 24.04, run:

npm init -y
npm install [email protected]
npx playwright-core install --with-deps webkit

Save the following as repro.mjs (UTF-8), then run node repro.mjs:

import { webkit } from "playwright-core";

const browser = await webkit.launch();
const page = await browser.newPage();
await page.route("http://fulfill.test/**", (route) =>
  route.fulfill({ contentType: "text/html; charset=utf-8", body: "<!doctype html><p>₹</p>" }),
);
await page.goto("http://fulfill.test/");
console.log(await page.evaluate(() => [document.characterSet, document.querySelector("p").textContent]));
await browser.close();
Expected behavior

[ 'UTF-8', '₹' ], as in Chromium and Firefox, and as WebKit gives when a real HTTP server sends the same Content-Type: text/html; charset=utf-8 header.

Actual behavior

[ 'windows-1252', '₹' ]. It's the same with headers: { "Content-Type": "text/html; charset=utf-8" } instead of contentType, with a Buffer body, and with text/html;charset=UTF-8.

Response Chromium 156 Firefox 157 WebKit 27.2
route.fulfill({ contentType, body: string }) UTF-8 ₹ UTF-8 ₹ windows-1252 ₹
route.fulfill({ headers, body: string }) UTF-8 ₹ UTF-8 ₹ windows-1252 ₹
route.fulfill({ contentType, body: Buffer }) UTF-8 ₹ UTF-8 ₹ windows-1252 ₹
route.fulfill({ status: 200, headers: { "content-type": "text/html;charset=UTF-8" }, body: Buffer }) UTF-8 ₹ UTF-8 ₹ windows-1252 ₹
Real HTTP server, same header UTF-8 ₹ UTF-8 ₹ UTF-8 ₹
Additional context

We hit this in a test whose fulfilled page embeds a srcdoc iframe containing an inline script with non-ASCII text, allowed by a CSP sha256- hash. Incorrect decoding of the outer page changed the iframe's script text, so its hash no longer matched and WebKit refused to run it. Adding <meta charset="utf-8"> to the fulfilled page works around it.

Environment
System:
    OS: Linux 7.2 Ubuntu 24.04.4 LTS 24.04.4 LTS (Noble Numbat)
    CPU: (16) x64 AMD Ryzen 9 8945HS w/ Radeon 780M Graphics
    Memory: 5.44 GB / 14.91 GB
    Container: Yes
  Binaries:
    Node: 24.19.0 - /opt/acttoolcache/node/24.19.0/x64/bin/node
    npm: 11.17.0 - /opt/acttoolcache/node/24.19.0/x64/bin/npm
  Languages:
    Bash: 5.2.21 - /usr/bin/bash
  npmPackages:
    playwright-core: ^1.64.1 => 1.64.1
主要言語
TypeScript
スター
98.5k
フォーク
6.7k
平均マージ
16時間 10分
マージ済み PR(30日)
305

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/playwright のほかの issue

microsoft/playwright の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。