Switch from Windows-1252 encoding to ISO-8859-1 encoding for mono compatibility.

lua-bytecode
Icedream 2014-10-23 02:49:01 +02:00
parent 1f07f6b053
commit 5d67d3e720
2 changed files with 3 additions and 3 deletions

View File

@ -81,7 +81,7 @@ namespace GarrysMod.AddonCreator.Addon
var stream = File.OpenRead(path); var stream = File.OpenRead(path);
{ {
var sr = new BinaryReader(stream, Encoding.GetEncoding("windows-1252")); var sr = new BinaryReader(stream, Encoding.GetEncoding("iso-8859-1"));
// Check format header // Check format header
if (!sr.ReadBytes(4).SequenceEqual(FormatIdent) if (!sr.ReadBytes(4).SequenceEqual(FormatIdent)
@ -260,7 +260,7 @@ namespace GarrysMod.AddonCreator.Addon
using (var stream = new MemoryStream()) using (var stream = new MemoryStream())
{ {
// TODO: Standardized encoding - Garry should use standardized encoding, currently he uses Encoding.Default which is applocale-dependent... // TODO: Standardized encoding - Garry should use standardized encoding, currently he uses Encoding.Default which is applocale-dependent...
var sw = new BinaryWriter(stream, Encoding.GetEncoding("windows-1252")); var sw = new BinaryWriter(stream, Encoding.GetEncoding("iso-8859-1"));
// Format header // Format header
sw.Write(FormatIdent); sw.Write(FormatIdent);

View File

@ -38,7 +38,7 @@ namespace GarrysMod.AddonCreator
} }
value += "\0"; value += "\0";
bw.Write(Encoding.GetEncoding("windows-1252").GetBytes(value)); bw.Write(Encoding.GetEncoding("iso-8859-1").GetBytes(value));
} }
} }
} }