Implement a clean_surrogates helper inside lib.sh's load_state_json function to recursively replace lone surrogates (e.g. from partial TUI screen dumps) with replacement chars before printing, preventing UnicodeEncodeError on stdout.
Implement a clean_surrogates helper inside lib.sh's load_state_json function to recursively replace lone surrogates (e.g. from partial TUI screen dumps) with replacement chars before printing, preventing UnicodeEncodeError on stdout.