hledger/hledger-lib/Hledger/Utils
Simon Michael 45d5fd7963 imp: show a clearer error message on unicode en/decoding failures [#73]
A very long-awaited improvement: for unicode exceptions, and I/O
exceptions which look like they were caused by a unicode error
(usually text decoding failure), our error message now includes
an explanation and advice on what to do.

Currently this uses the GHC.IO.Encoding API, which is not ideal:
"The API of this module is unstable and not meant to be consumed by
the general public. If you absolutely must depend on it, make sure to
use a tight upper bound, e.g., base < 4.X rather than base < 5,
because the interface can change rapidly without much warning."

Also it relies on scanning for patterns in GHC's various
unicode-related error messages, which may not be complete and could
change in future. To do: try the encoding package's IO helpers,
perhaps they give more specific exceptions.
2025-04-25 08:57:07 -10:00
..
Debug.hs dev: split debug/ghcdebug flags, comment out the latter for now 2024-10-24 10:44:28 -10:00
IO.hs imp: show a clearer error message on unicode en/decoding failures [#73] 2025-04-25 08:57:07 -10:00
Parse.hs dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse 2024-06-25 18:37:54 +01:00
Regex.hs dev: cleanups 2024-10-20 09:13:58 -10:00
String.hs feat: config file: add a real parser, support command-specific options 2024-06-25 18:37:54 +01:00
Test.hs dev: refactor: merge Text.Megaparsec.Custom into Hledger.Utils.Parse 2024-06-25 18:37:54 +01:00
Text.hs imp:print:beancount: conversion improvements 2023-11-23 01:47:15 -10:00