starwing / luautf8

a utf-8 support module for Lua and LuaJIT.
MIT License
406 stars 67 forks source link

parseucd.lua is incompatible with lua 5.1 #23

Closed SlySven closed 5 years ago

SlySven commented 5 years ago

Unfortunately line 74 of parseucd.lua uses the goto command. :scream:

This feature :roll_eyes: was only introduced in Lua 5.2 so is not supported by 5.1 ...

This is awkward because the unidata.h file is likely to be way out of date by now - the last commit to touch it was entitled "update UCD to 8.0.0" and Unicode is currently at 12.1.0 - importantly some codepoints changed their width in Unicode 9 and I am suspecting this is affecting my project (with an embedded lua interpreted which is fixed to Lua 5.1) and I want to ensure all parts are using the same reference data...

starwing commented 5 years ago

you just build a Lua5.2 and run it for once. It's not designed for run in your project, but just generate .c files.

I will make a update for this

SlySven commented 5 years ago

Ah, I have done so with a bit of a negation of the conditions for some if s... I will put it up as a PR shortly - and it does make some changes to the unidata.h file for the later Unicode data (at 12.1.0).

I note that there are multiple luarocks rockspec files and whilst yours (luautf8) do correctly link to the correct commits in the Git repository, those of Dan Note (utf8) incorrectly point to the base repository URL and so (AFAICT) they all pull in the master branch which represents your work as it was at the end of 2014!