We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c00c2c commit d508d03Copy full SHA for d508d03
src/api/encoding.cc
@@ -15,7 +15,11 @@ enum encoding ParseEncoding(const char* encoding,
15
switch (encoding[0]) {
16
case 'u':
17
case 'U':
18
- // utf8, utf16le
+ // Note: the two first conditions are needed for performance reasons
19
+ // as "utf8"/"utf-8" is a common case.
20
+ // (same for other cases below)
21
+
22
+ // utf, utf16le
23
if (encoding[1] == 't' && encoding[2] == 'f') {
24
// Skip `-`
25
const size_t skip = encoding[3] == '-' ? 4 : 3;
0 commit comments