Repository navigation
RemoteFortressReader: send creature/caste names and descriptions as UTF-8 in GetPartialCreatureRaws - #6021
Open
dwmuller wants to merge 1 commit into
Open
RemoteFortressReader: send creature/caste names and descriptions as UTF-8 in GetPartialCreatureRaws#6021dwmuller wants to merge 1 commit into
dwmuller wants to merge 1 commit into
Conversation
…o UTF-8 in GetPartialCreatureRaws Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6019
GetCreatureRaws/GetPartialCreatureRawscopied several DF strings (which are CP437) into protobufstringfields without conversion, so clients that validate UTF-8 (e.g. prost/Rust) reject the entire reply whenever a name contains a non-ASCII character such aså(0x86 in CP437, e.g. "Råsh").This wraps the affected calls in
DF2UTF, as is already done for material names, tissue names, etc.:CreatureRaw.nameCasteRaw.caste_nameCasteRaw.baby_name/child_nameCreatureRaw.general_baby_name/general_child_nameCasteRaw.descriptionIdentifier-like tokens (
creature_id,caste_id, body part tokens, etc.) are intentionally left alone, since they should be ASCII.A changelog entry is included under
Future→Fixes.Testing
RemoteFortressReader(RelWithDebInfo, MSVC 2022) from this branch; it matches the 53.16-r3 tag apart from thescriptssubmodule pointer.GetCreatureRawsnow decodes successfully and a raw wire scan finds no non-UTF-8 strings. The tests are in https://github.com/dwmuller/DFCompanion (tests/live_game_tests.rs).Compatibility
Prepared with GitHub Copilot under the direction of @dwmuller, who reviewed, built and tested the change against a live game.