Skip to content

Commit 9397ddc

Browse files
committed
Added luautf8 library
Fixed #8606 (Add support for unicode gsub, gmatch, find, match and reverse) Fixed #8600 (Using gsub on certain chars causes a graphical glich) See https://github.com/starwing/luautf8 for more details about the library
1 parent d139386 commit 9397ddc

File tree

10 files changed

+4389
-2
lines changed

10 files changed

+4389
-2
lines changed

mak.vs2008/lua5.1c_dll.vcproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,10 @@
393393
RelativePath="..\src\lundump.c"
394394
>
395395
</File>
396+
<File
397+
RelativePath="..\src\lutf8lib.c"
398+
>
399+
</File>
396400
<File
397401
RelativePath="..\src\lvm.c"
398402
>
@@ -501,6 +505,10 @@
501505
RelativePath="..\src\lzio.h"
502506
>
503507
</File>
508+
<File
509+
RelativePath="..\src\unidata.h"
510+
>
511+
</File>
504512
</Filter>
505513
</Files>
506514
<Globals>

mak.vs2008/lua5.1c_dll.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@
205205
<ClCompile Include="..\src\ltablib.c" />
206206
<ClCompile Include="..\src\ltm.c" />
207207
<ClCompile Include="..\src\lundump.c" />
208+
<ClCompile Include="..\src\lutf8lib.c" />
208209
<ClCompile Include="..\src\lvm.c" />
209210
<ClCompile Include="..\src\lzio.c" />
210211
<ClCompile Include="..\src\print.c" />
@@ -233,6 +234,7 @@
233234
<ClInclude Include="..\src\lundump.h" />
234235
<ClInclude Include="..\src\lvm.h" />
235236
<ClInclude Include="..\src\lzio.h" />
237+
<ClInclude Include="..\src\unidata.h" />
236238
</ItemGroup>
237239
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
238240
<ImportGroup Label="ExtensionTargets">

mak.vs2008/lua5.1c_dll.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<ClCompile Include="..\src\print.c">
100100
<Filter>src</Filter>
101101
</ClCompile>
102+
<ClCompile Include="..\src\lutf8lib.c">
103+
<Filter>src</Filter>
104+
</ClCompile>
102105
</ItemGroup>
103106
<ItemGroup>
104107
<ClInclude Include="..\src\lapi.h">
@@ -170,5 +173,8 @@
170173
<ClInclude Include="..\src\lzio.h">
171174
<Filter>inc</Filter>
172175
</ClInclude>
176+
<ClInclude Include="..\src\unidata.h">
177+
<Filter>inc</Filter>
178+
</ClInclude>
173179
</ItemGroup>
174180
</Project>

mak.vs2008/lua5.1s_dll.vcproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,10 @@
661661
RelativePath="..\src\lundump.c"
662662
>
663663
</File>
664+
<File
665+
RelativePath="..\src\lutf8lib.c"
666+
>
667+
</File>
664668
<File
665669
RelativePath="..\src\lvm.c"
666670
>
@@ -769,6 +773,10 @@
769773
RelativePath="..\src\lzio.h"
770774
>
771775
</File>
776+
<File
777+
RelativePath="..\src\unidata.h"
778+
>
779+
</File>
772780
</Filter>
773781
</Files>
774782
<Globals>

mak.vs2008/lua5.1s_dll.vcxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@
376376
<ClCompile Include="..\src\ltablib.c" />
377377
<ClCompile Include="..\src\ltm.c" />
378378
<ClCompile Include="..\src\lundump.c" />
379+
<ClCompile Include="..\src\lutf8lib.c" />
379380
<ClCompile Include="..\src\lvm.c" />
380381
<ClCompile Include="..\src\lzio.c" />
381382
<ClCompile Include="..\src\print.c" />
@@ -404,6 +405,7 @@
404405
<ClInclude Include="..\src\lundump.h" />
405406
<ClInclude Include="..\src\lvm.h" />
406407
<ClInclude Include="..\src\lzio.h" />
408+
<ClInclude Include="..\src\unidata.h" />
407409
</ItemGroup>
408410
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
409411
<ImportGroup Label="ExtensionTargets">

mak.vs2008/lua5.1s_dll.vcxproj.filters

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@
9999
<ClCompile Include="..\src\print.c">
100100
<Filter>src</Filter>
101101
</ClCompile>
102+
<ClCompile Include="..\src\lutf8lib.c">
103+
<Filter>src</Filter>
104+
</ClCompile>
102105
</ItemGroup>
103106
<ItemGroup>
104107
<ClInclude Include="..\src\lapi.h">
@@ -170,5 +173,8 @@
170173
<ClInclude Include="..\src\lzio.h">
171174
<Filter>inc</Filter>
172175
</ClInclude>
176+
<ClInclude Include="..\src\unidata.h">
177+
<Filter>inc</Filter>
178+
</ClInclude>
173179
</ItemGroup>
174180
</Project>

src/Makefile.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ liblua_la_SOURCES = \
1010
lstrlib.c loadlib.c linit.c \
1111
lapi.h ldebug.h lgc.h lmem.h lparser.h ltable.h lzio.h ldo.h llex.h \
1212
lobject.h lstate.h ltm.h lundump.h lcode.h lfunc.h llimits.h lopcodes.h \
13-
lstring.h lvm.h
13+
lstring.h lvm.h \
14+
unidata.h lutf8lib.c
1415

1516
EXTRA_DIST = luaconf.h.template.in
1617
BUILT_SOURCES = luaconf.h

src/lualib.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ LUALIB_API int (luaopen_package) (lua_State *L);
4343
/* open all previous libraries */
4444
LUALIB_API void (luaL_openlibs) (lua_State *L);
4545

46-
46+
/* Additional luautf8 library */
47+
LUALIB_API int luaopen_utf8(lua_State *L);
4748

4849
#ifndef lua_assert
4950
#define lua_assert(x) ((void)0)

0 commit comments

Comments
 (0)