Commit bca6644
fix: strip UTF-8 BOM from .env files (#640)
* 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>
* docs: add changelog entry for BOM fix
---------
Co-authored-by: h1whelan <h1whelan@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Saurabh Kumar <theskumar@users.noreply.github.com>1 parent 68ea2d1 commit bca6644
3 files changed
Lines changed: 35 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
460 | 463 | | |
461 | 464 | | |
462 | 465 | | |
| 466 | + | |
463 | 467 | | |
464 | 468 | | |
465 | 469 | | |
| |||
| 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