From 50d4b4b09c19aa23e1d2fc200f1f3d7a4572edd9 Mon Sep 17 00:00:00 2001 From: meehl <12648828+meehl@users.noreply.github.com> Date: Thu, 6 Nov 2025 16:55:31 +0100 Subject: [PATCH] Replace non-ASCII characters in text input with '?' This matches `SimpleGraphics` behavior and prevents a crash that can happen if PoB tries to delete a non-ASCII character. Fixes #9. --- CHANGELOG.md | 6 +++++- src/pob.rs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 41041a4..8c34ed3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## [Unreleased] - ReleaseDate +### Changed + +- Replace non-ASCII characters in text input with '?' + ## [0.2.7] - 2025-11-02 ### Added @@ -111,8 +115,8 @@ - First release -[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.7...HEAD +[Unreleased]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.7...HEAD [0.2.7]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.6...v0.2.7 [0.2.6]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.5...v0.2.6 [0.2.5]: https://github.com/meehl/rusty-path-of-building/compare/v0.2.4...v0.2.5 diff --git a/src/pob.rs b/src/pob.rs index 2d492b3..4a8c2c7 100644 --- a/src/pob.rs +++ b/src/pob.rs @@ -133,6 +133,7 @@ impl PoBMode { } } AppEvent::CharacterInput { ch } => { + let ch = if ch.is_ascii() { ch } else { '?' }; self.lua_instance .handle_event(PoBEvent::Char(ch), &mut ctx)?; }