Skip to content

Lua 5.3 implements bit32 as a native and utf8 as just utf8 not lua-utf8 #9412

@dschmitt007

Description

@dschmitt007

Similar to:
#5954
Lua 5.3 now includes the bit32 operators as a key word and changes lua-utf8 to utf8 (and the require will fail.)

A change of:

53c53
< __lua_lib_luautf8_Utf8 = _G.require("lua-utf8")
---
> __lua_lib_luautf8_Utf8 = _G.require("utf8")
785c785
<   local _hx_bit_raw = _G.require('bit32')
---
>   local _hx_bit_raw = bit32

fixes it

Probably room to insert conditionals based on version:
https://stackoverflow.com/questions/16257259/in-lua-is-there-a-function-that-will-tell-me-what-current-version-im-running, or walk through attempts to find what you want.

local _hx_bit_raw
if 32bit then
  _hx_bit_raw = 32bit
else
  _hx_bit_raw =  _G.require('bit32')

and

local success, module = pcall(require, 'utf8')
if not success then
    success, module = pcall(require, 'lua-utf8')
end
__lua_lib_luautf8_Utf8 = module

Metadata

Metadata

Assignees

Labels

platform-luaEverything related to Lua

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions