mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-22 17:29:18 +01:00
df43fd0d74
I kinda just felt like doing it :P wanted to test myself, trying to make a cleaner UI
19 lines
491 B
C#
19 lines
491 B
C#
using System.Text;
|
|
|
|
namespace HidLibrary
|
|
{
|
|
public static class Extensions
|
|
{
|
|
public static string ToUTF8String(this byte[] buffer)
|
|
{
|
|
var value = Encoding.UTF8.GetString(buffer);
|
|
return value.Remove(value.IndexOf((char)0));
|
|
}
|
|
|
|
public static string ToUTF16String(this byte[] buffer)
|
|
{
|
|
var value = Encoding.Unicode.GetString(buffer);
|
|
return value.Remove(value.IndexOf((char)0));
|
|
}
|
|
}
|
|
} |