Selaa lähdekoodia

Merge pull request #273 from ebeem/master

fix Unicode2Ascii does not return char of ascii code 255 (fixes #256)
Kevin Morgan 4 vuotta sitten
vanhempi
sitoutus
533e8b0f22

+ 1 - 1
src/MoonSharp.Interpreter/CoreLib/StringModule.cs

@@ -102,7 +102,7 @@ namespace MoonSharp.Interpreter.CoreLib
 
 		private static int Unicode2Ascii(int i)
 		{
-			if (i >= 0 && i < 255)
+			if (i >= 0 && i <= 255)
 				return i;
 
 			return (int)'?';

+ 1 - 1
src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/CoreLib/StringModule.cs

@@ -102,7 +102,7 @@ namespace MoonSharp.Interpreter.CoreLib
 
 		private static int Unicode2Ascii(int i)
 		{
-			if (i >= 0 && i < 255)
+			if (i >= 0 && i <= 255)
 				return i;
 
 			return (int)'?';