Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inaccurate encoding detection output in debug mode #3521

Open
j9t opened this issue Nov 2, 2024 · 0 comments
Open

Inaccurate encoding detection output in debug mode #3521

j9t opened this issue Nov 2, 2024 · 0 comments

Comments

@j9t
Copy link

j9t commented Nov 2, 2024

Operating system

macOS Sonoma 14.6.1 (23G93)

Eleventy

3.0.0

Describe the bug

Running all Eleventy operations in debug mode (DEBUG=Eleventy* npx @11ty/eleventy), I noticed inaccurate encoding output (in this case of a project with 10k+ files, more than 10,000 output messages).

Example:

  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './tools/feed/htaccess.njk'. +8ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './tools/feed/rss.njk'. +1ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './_views/default.njk'. +18ms
…
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './tools/exploration/typography/type-scale-generator-jeremy-church.md'. +1ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './tools/exploration/typography/type-scale-generator-tim-brown.md'. +0ms
  Eleventy:TemplateContent 'ISO-8859-1' encoding detected on './tools/exploration/typography/web-font-generator.md'. +0ms

The problem is that the files are all in UTF-8 (encoding for everything in my env). I took some samples to confirm, and every file I checked was UTF-8. WebStorm indicates this conveniently:

“UTF-8” indication in WebStorm status bar.

Interestingly, it doesn’t seem Eleventy would generally fail with encoding recognition, as these examples show:

  Eleventy:TemplateContent 'UTF-8' encoding detected on './pages/tags.njk'. +52ms
  Eleventy:TemplateContent 'UTF-8' encoding detected on './pages/tools.njk'. +32ms
  Eleventy:TemplateContent 'UTF-8' encoding detected on './pages/tag/rss.njk'. +1ms

Filing this to improve encoding detection, but also to help in case this could be something to improve Eleventy performance with.

(Note: I’d say I have sold-enough knowledge of Unicode, but can’t rule out I’m missing something here that would explain why Eleventy would misidentify the encoding.)

Reproduction steps

Can give access to the currently private repo in question:

  1. Run Eleventy in debug mode, e.g. DEBUG=Eleventy* npx @11ty/eleventy --incremental
  2. Pay attention to “encoding detected” messages
  3. In project exclusively using UTF-8, Eleventy would detect ISO-8559-1

Expected behavior

  1. Eleventy would detect the correct encoding

Reproduction URL

No response

Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant