'Bitmask for converting letters to uppercase

I can't seem to figure out a bitmask for converting both upper case and lower case letters to upper case. I know I can use XOR 00100000 for converting lowercase to uppercase but this would not work if I XOR an upper case letter with 00100000 back to the same upper case letter. Is there a way to do this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source