From https://en.wikipedia.org/wiki/Wikipedia_talk:Lua#mw.ustring.byteoffset_bug:
Does mw.ustring.byteoffset work correctly with negative offsets? Putting the
following into the debug window gives the values shown:for i = -1, -5, -1 do print(i, mw.ustring.byteoffset('abcde', 0, i)) end
-1 3
-2 2
-3 1
-4 nil
-5 nilI don't need the function—I'm just asking if it has a bug. Johnuniq (talk)
02:22, 25 June 2013 (UTC)
Further investigation reveals that the LuaStandalone implementation works correctly, it's only LuaSandbox that has the problem.
Patch to be submitted momentarily.
Version: master
Severity: normal