diff --git a/manual/luatex-tex.tex b/manual/luatex-tex.tex index 65b9458619deacac1f8e6e12f0a97bce739358e8..0924896288fbe01b5e04cf2dc99a7a7f0964d274 100644 --- a/manual/luatex-tex.tex +++ b/manual/luatex-tex.tex @@ -113,6 +113,18 @@ checking some mechanism going haywire. \stopsubsection +\startsubsection[title={Code page (Windows only)}] + +\libindex{getcodepage} + +The \type {getcodepage} returns the value from \type{GetOEMCP()} +(the current original equipment manufacturer (OEM) code page identifier for the operating system) +and the value from \type{GetACP()} (the current Windows ANSI code page identifier for the operating system). + +\stopsubsection + + + \stopsection \startsection[title={The \type {status} library}][library=status] diff --git a/manual/luatex.pdf b/manual/luatex.pdf index f84677d0c27c3caafbc8ecf30fb1a4c14c61b99e..8ecac27756c94c2cc45fd37774952e56e7c80cd8 100644 Binary files a/manual/luatex.pdf and b/manual/luatex.pdf differ diff --git a/source/texk/web2c/luatexdir/ChangeLog b/source/texk/web2c/luatexdir/ChangeLog index 30afe026f3fe1f7b8e54422b7855195eaa020326..fadf29dcd9c3fd6dd5b05d8b92c97eb03631a357 100644 --- a/source/texk/web2c/luatexdir/ChangeLog +++ b/source/texk/web2c/luatexdir/ChangeLog @@ -1,3 +1,7 @@ +2019-10-28 Luigi Scarso <luigi.scarso@gmail.com> + * New callback lua.getcodepage() for diagnostic purposes. + + 2019-10-25 Luigi Scarso <luigi.scarso@gmail.com> * Also support {oeps.foo} filenames in openin/out diff --git a/source/texk/web2c/luatexdir/NEWS b/source/texk/web2c/luatexdir/NEWS index ba63f727ae403b2ce9ea990584635540f0f183bb..42732fae0777e6c39c31171d20738176672f0e0c 100644 --- a/source/texk/web2c/luatexdir/NEWS +++ b/source/texk/web2c/luatexdir/NEWS @@ -7,6 +7,7 @@ First release of luahbtex / luajithbtex, luatex / luajittex with harfbuzz. Small bug fixes, code clean up and a couple of new primitives to match eTeX. +A new callcback lua.getcodepage() for diagnostic purposes. *** DROPPED the "page_objnum_provider" callback, replaced with "page_order_index". *** See ChangeLog and the manual. diff --git a/source/texk/web2c/luatexdir/lua/llualib.c b/source/texk/web2c/luatexdir/lua/llualib.c index ac9b03ffe60c8c8aabf4fcc4ac9752712e864b40..0586aba026e95d9624c1d3df840639d4c407cef1 100644 --- a/source/texk/web2c/luatexdir/lua/llualib.c +++ b/source/texk/web2c/luatexdir/lua/llualib.c @@ -379,16 +379,29 @@ static int get_call_level(lua_State * L) /* hh */ return 1; } +static int get_code_page(lua_State *L) +{ +# ifdef _WIN32 + lua_pushinteger(L,(int) GetOEMCP()); + lua_pushinteger(L,(int) GetACP()); +# else + lua_pushboolean(L,0); + lua_pushboolean(L,0); +# endif + return 2; +} + static const struct luaL_Reg lualib[] = { /* *INDENT-OFF* */ - {"getluaname", get_luaname}, - {"setluaname", set_luaname}, + {"getluaname", get_luaname}, + {"setluaname", set_luaname}, {"getbytecode", get_bytecode}, {"setbytecode", set_bytecode}, - {"newtable", new_table}, + {"newtable", new_table}, {"get_functions_table",lua_functions_get_table}, - {"getstacktop",get_stack_top}, + {"getstacktop", get_stack_top}, {"getcalllevel", get_call_level}, + {"getcodepage", get_code_page }, /* *INDENT-ON* */ {NULL, NULL} /* sentinel */ }; diff --git a/source/texk/web2c/luatexdir/luatex_svnversion.h b/source/texk/web2c/luatexdir/luatex_svnversion.h index 47770e44ed43f17db28a2c4654246d109bc8bf71..b7d2d9796feb0fee9bace9e6c03e4c10cabeba73 100644 --- a/source/texk/web2c/luatexdir/luatex_svnversion.h +++ b/source/texk/web2c/luatexdir/luatex_svnversion.h @@ -1 +1 @@ -#define luatex_svn_revision 7211 +#define luatex_svn_revision 7215