When I parse in the string Frànçoïs via FXmlNode::GetAttribute, it keeps coming out Frà nçoïs, any ideas how to handle that? My XML file’s encoding is utf-8. The result is being stored in an FString, but in blueprints with Make Literal String it seems to handle the characters in Frànçoïs just fine.
I don’t know what is FXmlNode, but the internationalization system in UE4 works fine with french characters, I don’t need to encode them personaly (I’m french if it can help)
Thanks for the reply, but if you’re referring to the localization dashboard or commandlets system, those have not been able to work for my project ( [4.12.3] Localization Dashboard Can't Match Criteria for Packages - Programming & Scripting - Unreal Engine Forums ). FXmlNode is part of the XmlParser.h module ( XmlParser | Unreal Engine Documentation ) for parsing XML files, but it seems to be restricted in its charset-encoding support.
Instead of storing it as FString, can you try storing it as FText, and see if it still has the same issue with the characters in the string?
Thanks.
Thanks for the reply, but it’s the API function FXmlNode::GetAttribute itself that has an FString return value. Unless there’s an FText overload?
Can you try something like:
MyTextVariable = FText::FromString( XmlNodeReference->GetAttribute( ) );
In Visual Studio, the UE4Editor-Core.dll doesn’t load the symbols for the result of FText textKeyT = FText::FromString( currSibling->GetAttribute( TEXT_KEY_ATTRIBUTE_TAG ) ); unfortunately. Printing it to the screen through AddOnScreenDebugMessage would require it to be converted to a string, too. I’ll try to work on getting it directly if I get the free time, need to change a good number of blueprint variables from Strings to Text variables.
Kyle – Finally got some time to test out the suggestion, it doesn’t repair the problem sadly. Still garbled up for me in the same way. Our school program’s second development team here at SMU Guildhall has reported the exact same problem, as well.
Furthermore, it doesn’t seem viable for creating a map of the FText results, because a TMap (for mapping text keys to their translations) appears to fail compilation.
Hi,
I have the same issue only with chinese not french, I think if the parser doesn’t do the converting, we can only try different encodings. Still struggling with this, good luck.
Hey, I am back.
I finally solve the problem by changing my xml file encoding with USC-2 LE BOM in the Notepad++ editor.