Skip to content

Commit 4f4e6cd

Browse files
committed
fix Unicode2Ascii does not return char of ascii code 255 (fixes #256)
1 parent 4e748a7 commit 4f4e6cd

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)