Making a custom umg widget keyboard. Trying to set-up the CAPS key.
Simplest form example…
The following characters required for specific language…
À, à, É, é
From any point in any blueprint… (mine is specifically with in a HUD widget BP)
create a MakeLiteralString with Value as any of the above characters
convert either ToUpper or ToLower
output to - PrintString
RESULT - NO CHANGE
Change the literal string to “standard character” like A,a,E,e - it works
Trying to loop through children of widget slot to change all key text. Working great except for the special characters as noted.
I could work around by explicitly setting to text change for every key/button. But that is just silly.
Any suggestions would be greatly appreciated?
Call this function before game starts and ToUpper() will work correctly:
`
#include locale
void SetGlobalLocale(const FString aLocale)
{
std::locale::global(std::locale(TCHAR_TO_UTF8(*aLocale)));
}
`
Add the symbols “<” and “>” around the “locale” word in include.
Here are examples of valid locales:
"en-US" "ru-ru" "fr-fr" "es-es" "de-de" "zh-cn"
This is a know issue with FString.
As of 4.16 FText supports ToUpper/ToLower in an internationalisation friendly way.
Jamie_Dale
(Jamie Dale)
September 26, 2017, 3:46pm
4
I can’t give you a specific CL# as the change was made in one of our internal game branches so came back in a merge.
If you have 4.16 source code you can take a look for FTextHistory_Transform
and apply that class and its usage to 4.15. Thankfully Transform
was the next entry in ETextHistoryType
(after AsDateTime
) so you shouldn’t run into any serialisation issues there. Also check out UKismetTextLibrary
for the Blueprint exposure of FText::ToUpper
and FText::ToLower
.
Hi , we are having the same issue (locked to 4.15) and were wondering if you could isolate the CL’s to grab from the 4.16 repo to get this to work?
Thanks for the quick reply, i’ll take a look at this and get back to you.
How to solve this with blueprint?
Forget it. Using ToUpper on the text worked, but not string.