This issue has been closed as 'Won't Fix' due to an extended period of time without updates. If this issue is important to you please let us know by posting on the AnswerHub or UDN, and Epic will re-open the ticket for further review.
When a UTF-16 character (™ for example) is passed into a StringToBytes() function and then returned via BytesToString, the returned character does not match (in the case of ™, a double quotes is returned instead).
FString inString(TEXT("™"));
uint32 size = inString.Len();
TArray<uint8> data;
data.AddUninitialized(size);
StringToBytes(inString, data.GetData(), size);
FString outString = BytesToString(data.GetData(), size);
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Red, inString);
GEngine->AddOnScreenDebugMessage(-1, 10.f, FColor::Green, outString);
Result:
™ is printed as the inString and " is printed as the outString
Expected:
™ is returned for both the inString and outString.
Head over to the existing Questions & Answers thread and let us know what's up.
11 |
Component | UE - Foundation - Core |
---|---|
Affects Versions | 4.12.5 |
Created | Jul 28, 2016 |
---|---|
Resolved | Mar 26, 2018 |
Updated | Apr 27, 2018 |