Hello,
I have a problem with processing a Lua file similar to that with \typefile described several days (weeks?) ago.
Let's have the following files:
- Ctx:
---
\mainlanguage[cz]
\enableregime[cp1250]
\starttext
AAA
\startluacode
local t = dofile("t.lua")
context(t)
\stopluacode
\stoptext
---
- And the t.lua:
---
-- return "111" -- This worked OK
return "žšč" -- This is problem for Ctx
---
When I try the t.lua from Win console by "Lua -e dofile('t.lua')", there is no problem.
When I run the Ctx file, it has problem processing characters with diacritics (like "čřž..."); the t.lua is not encoded in UTF-8 (which seems to be supposed by Ctx-Lua), but I'm using the cp1250 code page + each character = 1 B.
The error message is:
---
MTXrun | run 1: luatex --fmt="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c/formats/cont-en" --lua="c:/ConTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c/formats/cont-en.lui" --backend=pdf "D:/L
ukas/ConTeXt/Samples/U8/t-U8.mkiv"This is LuaTeX, Version beta-0.63.0-2010090921 (rev 3873)
\write18 enabled.
(D:/Lukas/ConTeXt/Samples/U8/t-U8.mkiv
jobcontrol > resuming randomizer with 0.50767540513321
ConTeXt ver: 2010.10.20 21:33 MKIV fmt: 2010.10.21 int: english/english
system : cont-new loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-new.mkiv))
system : cont-fil.mkiv loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-fil.mkiv
loading : ConTeXt File Synonyms
)
system : cont-sys.rme loaded
(c:/ConTeXt/tex/texmf-context/tex/context/user/cont-sys.rme (c:/ConTeXt/tex/texmf-context/tex/context/base/type-def.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-lua.mkiv) (c:/ConTeXt/tex/texmf-context/tex/context/base/type-siz.mkiv) (c:/ConTeX
t/tex/texmf-context/tex/context/base/type-otf.mkiv))
system : cont-err loaded
(c:/ConTeXt/tex/texmf-context/tex/context/base/cont-err.tex
systems : no file 'cont-sys.tex', using 'cont-sys.rme' instead
)
system : t-U8.top loaded
(t-U8.top
)
fonts : preloading latin modern fonts
{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-math.map}{c:/ConTeXt/tex/texmf/fonts/map/dvips/lm/lm-rm.map}{c:/ConTeXt/tex/texmf-context/fonts/map/pdftex/context/mkiv-base.map}
bodyfont : 12pt rm is loaded
language : language en is active
publications : loading formatting style from bxml-apa
(c:/ConTeXt/tex/texmf-context/tex/context/base/bxml-apa.mkiv)
systems : begin file D:/Lukas/ConTeXt/Samples/U8/t-U8.mkiv at line 4
! String contains an invalid utf-8 sequence.
system > error on line 1 in file D:/Lukas/ConTeXt/Samples/U8/t-U8.mkiv: String contains an invalid utf-8 sequence ...
1 >> \mainlanguage[cz]
2 \enableregime[cp1250]
3
4 \starttext
5 AAA
6
7 \startluacode
8 local t = dofile("t.lua")
9
10 context(t)
11 \stopluacode
l.1
×ÜŔ
} context(t)> ...le("t.lua")
\dodostartluacode ...d \directlua \zerocount {#1}}
l.11 \stopluacode
backends > using xmp file 'c:/ConTeXt/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages > flushing realpage 1, userpage 1, subpage 1
systems : end file D:/Lukas/ConTeXt/Samples/U8/t-U8.mkiv at line 12
)