mirror of
https://github.com/raylib-cs/raylib-cs
synced 2025-09-09 03:01:41 -04:00
Testing string approaches
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Raylib_cs
|
||||
{
|
||||
@@ -206,5 +207,15 @@ namespace Raylib_cs
|
||||
|
||||
return byteArray;
|
||||
}
|
||||
|
||||
public static unsafe string GetUTF8String(byte* bytes)
|
||||
{
|
||||
return Marshal.PtrToStringUTF8((IntPtr)bytes);
|
||||
}
|
||||
|
||||
public static byte[] GetUTF8Bytes(this string text)
|
||||
{
|
||||
return Encoding.UTF8.GetBytes(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user