‘U’ and ‘u’ are two different symbols. And you have to make such rules for every language a part of your processing logic.
Unicode has standard rules for case folding, which includes the rules for all languages supported by Unicode. Case-insensitive comparisons in all good programming languages uses this data.