Commit d15da81
[ANE-2795] Fix UTF-8 encoding for ficus output on Windows (#1646)
* Fix UTF-8 encoding crash when reading ficus stderr on Windows
Use Conduit with decodeUtf8Lenient for stderr handling, matching the
approach already used for stdout. This prevents crashes on Windows
where the default system encoding (CP1252) cannot decode UTF-8 characters
like box-drawing characters (U+2501) used in ficus progress output.
The decodeUtf8Lenient function safely handles any byte sequence by
replacing invalid UTF-8 with the Unicode replacement character (U+FFFD)
instead of throwing an exception.
Fixes: ANE-2795
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix UTF-8 encoding when writing ficus debug logs on Windows
Set explicit UTF-8 encoding on debug log file handles. On Windows,
file handles default to the system code page (CP1252), which cannot
encode Unicode characters like box-drawing characters (U+2501) used
in ficus's Rust SPANTRACE output.
Without this fix, running `fossa analyze --x-vendetta --debug` on
Windows crashes with:
commitBuffer: invalid argument (cannot encode character '\9473')
This complements the previous fix for reading ficus output by ensuring
the writing side also handles UTF-8 correctly.
Fixes: ANE-2795
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Simplify stderr accumulator and fix formatting
- Remove redundant count tracking from stderr fold (take 50 on a bounded
list is already O(1))
- Use Text throughout msg construction instead of String intermediates
- Remove trailing blank line to satisfy formatter
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 47bf7c4 commit d15da81
2 files changed
Lines changed: 28 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
| 268 | + | |
268 | 269 | | |
| 270 | + | |
269 | 271 | | |
270 | 272 | | |
271 | 273 | | |
| |||
354 | 356 | | |
355 | 357 | | |
356 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
357 | 363 | | |
358 | 364 | | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
| |||
0 commit comments