diff options
Diffstat (limited to 'apps/plugins/lua')
| -rw-r--r-- | apps/plugins/lua/rocklib.c | 13 | ||||
| -rwxr-xr-x | apps/plugins/lua/rocklib_aux.pl | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/apps/plugins/lua/rocklib.c b/apps/plugins/lua/rocklib.c index 54c2bc0..ed625ca 100644 --- a/apps/plugins/lua/rocklib.c +++ b/apps/plugins/lua/rocklib.c @@ -472,6 +472,16 @@ RB_WRAP(create_numbered_filename) return 1; } +RB_WRAP(utf8encode) +{ + unsigned long ucs = (unsigned long) luaL_checkint(L, 1); + unsigned char tmp[9]; + unsigned char *end = rb->utf8encode(ucs, tmp); + *end = '\0'; + lua_pushstring(L, tmp); + return 1; +} + #define RB_FUNC(func) {#func, rock_##func} static const luaL_Reg rocklib[] = { @@ -520,6 +530,9 @@ static const luaL_Reg rocklib[] = #if CONFIG_CODEC == SWCODEC RB_FUNC(pcm), #endif + + RB_FUNC(utf8encode), + {NULL, NULL} }; #undef RB_FUNC diff --git a/apps/plugins/lua/rocklib_aux.pl b/apps/plugins/lua/rocklib_aux.pl index f52c64e..f3705bf 100755 --- a/apps/plugins/lua/rocklib_aux.pl +++ b/apps/plugins/lua/rocklib_aux.pl @@ -70,6 +70,9 @@ my @forbidden_functions = ('^open$', '^s?+rand$', '^strl?+cpy$', '^strl?+cat$', + '^iso_decode$', + '^utf8encode$', + '^utf16', '^codec_', '^timer_', '^lcd_(mono_)?+bitmap', |