UTF-8 does not reset state when returning error
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript
調査の方向性
Start by reading issue #358 and the TextDecoder decode examples in this issue. Compare the reported Chrome, WebKit, Firefox, Node.js, Deno, and Bun behavior, then determine the intended handling of decoder errors and the “BOM seen” state; done means the Encoding Standard specifies the behavior consistently.
索引モデルが issue の本文から書いたものです。
説明
What is the issue with the Encoding Standard?
Same as #358 but for Unicode BOM
If the proposal of #358 is to reset state for errors, then what should happen to BOM seen?
I don't argue that it should be reset, but there is definitely some sort of issue and inconsistency there
Platform status is highly inconsistent:
const r = (d, ...a) => {
try {
return d.decode(...a).length
} catch {}
return 'e'
}
const a = new TextDecoder('utf8', { fatal: true })
console.log('A',
r(a, Uint8Array.of(0xef, 0xbb, 0xbf, 0xff), { stream: true }),
r(a, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }), // error does not stick in Chrome/Safari
)
const b = new TextDecoder('utf8', { fatal: true })
console.log('B',
r(b, Uint8Array.of(0xef, 0xbb, 0xbf, 0xef), { stream: true }),
r(b, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
r(b, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }), // error sticks in Chrome / Safari
r(b, Uint8Array.of(0xbb, 0xbf), { stream: true }),
r(b, Uint8Array.of(), { stream: true }),
)
const c = new TextDecoder('utf8', { fatal: true })
console.log('C',
r(c, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
r(c, Uint8Array.of(0xff), { stream: true }),
r(c, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
)
// Bonus: if BOM is not reset, is it processed on errors?
const d = new TextDecoder('utf8', { fatal: true })
const e = new TextDecoder('utf8', { fatal: true })
console.log('D',
r(d, Uint8Array.of(0x20, 0xff), { stream: true }),
r(d, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
r(d, Uint8Array.of(0xff), { stream: true }),
r(d, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
r(e, Uint8Array.of(0xff), { stream: true }),
r(e, Uint8Array.of(0xef, 0xbb, 0xbf), { stream: true }),
)
Chrome: first error did not get stuck, second error got stuck
A e 0
B 0 e e e e
C 0 e 1
D e 0 e 1 e 0
WebKit: first error did not get stuck, second error got stuck
A e 1
B 0 e e e e
C 0 e 1
D e 1 e 1 e 0
Firefox, Servo, Deno, Static Hermes: errors do not stick, bom does not get reset, bom seen is set on errors
A e 1
B 0 e 1 e 0
C 0 e 1
D e 1 e 1 e 1
Node.js: errors do not stick
A e 0
B 0 e 1 e 0
C 0 e 1
D e 0 e 1 e 0
Bun: just broken
A e 0
B 0 0 0 1 0
C 0 e 0
D e 0 e 0 e 0
- 主要言語
- HTML
- スター
- 323
- フォーク
- 94
- 平均マージ
- 21分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
whatwg/encoding のほかの issue
-
topic: api
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
topic: api
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
-
Add support for [AllowResizable] inputs対応中かも @daxpedda が 224 日前に担当しました。 オープンaddition/proposal topic: api
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
-
addition/proposal needs implementer interest
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
whatwg/encoding の issue をすべて見る
似ている issue
-
ai-driven-fuzzing bug claude Minor
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
linagora/cozy-client#1769 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] micronaut-serde-oracle-jdbc-json brings a second OJDBC driver onto the runtime classpath対応中かも @ZARAYACH が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
micronaut-projects/micronaut-serialization#1494 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 2 日以内に返信