From ec520294324c9af1feed85406684d9feec431d35 Mon Sep 17 00:00:00 2001 From: Jhobean Date: Thu, 31 Oct 2024 20:50:00 -0400 Subject: [PATCH] Add UTF8 Support on Tiledata --- Ultima/Helpers/TileDataHelpers.cs | 4 ++-- Ultima/TileData.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Ultima/Helpers/TileDataHelpers.cs b/Ultima/Helpers/TileDataHelpers.cs index 5bcfc71..9e5eae5 100644 --- a/Ultima/Helpers/TileDataHelpers.cs +++ b/Ultima/Helpers/TileDataHelpers.cs @@ -26,7 +26,7 @@ public static unsafe string ReadNameString(byte* buffer) _stringBuffer[count] = *buffer++; } - return Encoding.ASCII.GetString(_stringBuffer, 0, count); + return Encoding.UTF8.GetString(_stringBuffer, 0, count); } public static string ReadNameString(byte[] buffer, int len) @@ -38,7 +38,7 @@ public static string ReadNameString(byte[] buffer, int len) //; } - return Encoding.ASCII.GetString(buffer, 0, count); + return Encoding.UTF8.GetString(buffer, 0, count); } public static int ConvertStringToInt(string text) diff --git a/Ultima/TileData.cs b/Ultima/TileData.cs index 39c3c1f..91f0c6d 100644 --- a/Ultima/TileData.cs +++ b/Ultima/TileData.cs @@ -1419,7 +1419,7 @@ public static void SaveTileData(string fileName) var b = new byte[20]; if (LandTable[i].Name != null) { - byte[] bb = Encoding.ASCII.GetBytes(LandTable[i].Name); + byte[] bb = Encoding.UTF8.GetBytes(LandTable[i].Name); if (bb.Length > 20) { Array.Resize(ref bb, 20); @@ -1464,7 +1464,7 @@ public static void SaveTileData(string fileName) var b = new byte[20]; if (ItemTable[i].Name != null) { - byte[] bb = Encoding.ASCII.GetBytes(ItemTable[i].Name); + byte[] bb = Encoding.UTF8.GetBytes(ItemTable[i].Name); if (bb.Length > 20) { Array.Resize(ref bb, 20);