Skip to content

Commit 533e8b0

Browse files
authored
Merge pull request moonsharp-devs#273 from ebeem/master
fix Unicode2Ascii does not return char of ascii code 255 (fixes moonsharp-devs#256)
2 parents d5afab3 + 4f4e6cd commit 533e8b0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/MoonSharp.Interpreter/CoreLib/StringModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static DynValue unicode(ScriptExecutionContext executionContext, Callback
102102

103103
private static int Unicode2Ascii(int i)
104104
{
105-
if (i >= 0 && i < 255)
105+
if (i >= 0 && i <= 255)
106106
return i;
107107

108108
return (int)'?';

src/MoonSharp.Interpreter/_Projects/MoonSharp.Interpreter.netcore/src/CoreLib/StringModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public static DynValue unicode(ScriptExecutionContext executionContext, Callback
102102

103103
private static int Unicode2Ascii(int i)
104104
{
105-
if (i >= 0 && i < 255)
105+
if (i >= 0 && i <= 255)
106106
return i;
107107

108108
return (int)'?';

0 commit comments

Comments
 (0)