This repository was archived by the owner on Jun 28, 2026. It is now read-only.
search char equivalences unicode#1
Open
com-master wants to merge 1 commit into
Open
Conversation
Illiux
approved these changes
Jun 15, 2026
Illiux
left a comment
There was a problem hiding this comment.
I already reviewed this on the other repo, so I'm just also dropping an approval here.
DrSmugleaf
approved these changes
Jun 17, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
I dont care whats happend with space wizards and pjb, i just want send my code to community. Equivalent pr on original robust toolbox - space-wizards/RobustToolbox#6636
Summary
Some languages have letters that players commonly type interchangeably, but which are technically distinct Unicode code points. The most common example is Russian ё and е: native speakers almost universally write е in informal text, but entity names in YAML may use ё, causing searches to miss results. The same problem exists in other languages (German umlauts typed without diacritics, etc.).
This PR adds a lightweight, language-agnostic mechanism to fold such characters before comparing search strings.
What changed
Robust.Shared/Utility/SearchHelpers.cs — new public static class with:
Robust.Shared/CVars.cs — new CVar interface.search_char_equivalences:
EntitySpawningUIController, TileSpawningUIController — search filters switched to ContainsSearch
Why config-driven
Hardcoding equivalences would require a code change for every new language. A CVar lets server owners, localization teams, or individual players add pairs for their language without touching the engine. The default list covers the most common cases; anything beyond that is one config line away.
Usage from game content
// No setup needed — works anywhere IoC is available
if (entityName.ContainsSearch(searchString))
...
Future work
This PR lays the groundwork in the engine. A follow-up change on the content side (Space Station 14) is planned to roll out ContainsSearch across all in-game search interfaces — crafting machines, research consoles, cargo order menus, and any other UI that filters lists by player input. Since SearchHelpers is self-initializing and requires no wiring, the content-side change is purely a find-and-replace of .Contains( with .ContainsSearch( in the relevant UI systems.
Done, switched to CompareInfo.IndexOf with CompareOptions.IgnoreNonSpace | CompareOptions.IgnoreCase. The custom CVar and character table are gone — Unicode NFD decomposition handles everything automatically. The implementation is now a single static method with no dependencies, no configuration, and no setup required.
Example of this feature on russian fork.

Both spellings of the word черный and чёрный are acceptable in Russian, and the two forms are now treated as equivalent when compared by the program.