mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 02:09:23 +08:00
decode_escaped_unicode_for_display repairs double-encoded \uXXXX runs (#973) with the unicode_escape codec, which turns a surrogate-pair escape for an emoji into two lone surrogates instead of one emoji. The result cannot be encoded as UTF-8, so an ask_user card or mastery question whose escaped text contains an emoji fails when the event is persisted to SQLite or sent over the WebSocket. Decode each run as a JSON string instead, matching the web decoder's JSON.parse, and leave runs with an unpaired surrogate escaped.