We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b23bea6 commit 173747cCopy full SHA for 173747c
1 file changed
fallback/encoding.js
@@ -295,6 +295,7 @@ const uppercasePrefixes = new Set(['utf', 'iso', 'koi', 'euc', 'ibm', 'gbk'])
295
// https://encoding.spec.whatwg.org/#names-and-labels
296
export function labelToName(label) {
297
const enc = normalizeEncoding(label)
298
+ if (enc === 'utf-8') return 'UTF-8' // fast path
299
if (!enc) return enc
300
if (uppercasePrefixes.has(enc.slice(0, 3))) return enc.toUpperCase()
301
if (enc === 'big5') return 'Big5'
0 commit comments