Commit dfc5543
Fix: strip UTF-8 BOM from .env files to prevent silent first-variable loss
When a .env file is saved with a UTF-8 BOM (common with JetBrains IDEs
on Windows), the BOM character (\ufeff) was prepended to the first
variable name, making it silently inaccessible via its intended key.
Strip the BOM in Reader.__init__ so all variables are parsed correctly
regardless of whether the file contains a BOM.
Fixes #637
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent fa4e6a9 commit dfc5543
2 files changed
+30
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
545 | 545 | | |
546 | 546 | | |
547 | 547 | | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
548 | 577 | | |
549 | 578 | | |
550 | 579 | | |
| |||
0 commit comments