You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
EpicGames.Core: Add constructor to make a Utf8String from a ReadOnlySpan<char>.
#preflight none [CL 23108577 by Ben Marsh in ue5-main branch]
This commit is contained in:
@@ -52,6 +52,18 @@ namespace EpicGames.Core
|
||||
Memory = Encoding.UTF8.GetBytes(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="text">Text to construct from</param>
|
||||
public Utf8String(ReadOnlySpan<char> text)
|
||||
{
|
||||
int length = Encoding.UTF8.GetByteCount(text);
|
||||
byte[] buffer = new byte[length];
|
||||
Encoding.UTF8.GetBytes(text, buffer);
|
||||
Memory = buffer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user