From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62795 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5?= Newsgroups: gmane.comp.tex.context Subject: Problem processing a non-UTF8 Lua script Date: Thu, 21 Oct 2010 10:00:10 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=----------S1FhwgUheoAYeGUzw6p3vA X-Trace: dough.gmane.org 1287648045 12649 80.91.229.12 (21 Oct 2010 08:00:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 21 Oct 2010 08:00:45 +0000 (UTC) To: ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Thu Oct 21 10:00:44 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P8q4n-0004Ox-RQ for gctc-ntg-context-518@m.gmane.org; Thu, 21 Oct 2010 10:00:41 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 98495CA769; Thu, 21 Oct 2010 10:00:40 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id hHyFtbNlVXoD; Thu, 21 Oct 2010 10:00:37 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9AFACA758; Thu, 21 Oct 2010 10:00:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2F693CA758 for ; Thu, 21 Oct 2010 10:00:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id A1AIHvGCs59R for ; Thu, 21 Oct 2010 10:00:32 +0200 (CEST) Original-Received: from filter5-ams.mf.surf.net (filter5-ams.mf.surf.net [192.87.102.73]) by balder.ntg.nl (Postfix) with ESMTP id 48885CA756 for ; Thu, 21 Oct 2010 10:00:32 +0200 (CEST) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter5-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9L80Txc014844 for ; Thu, 21 Oct 2010 10:00:30 +0200 Original-Received: from lk-2008-nbk ([90.176.144.79]) (authenticated user lpr@pontex.cz) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Thu, 21 Oct 2010 10:00:28 +0200 User-Agent: Opera Mail/10.10 (Win32) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=89.233.168.98; country=CZ; region=52; city=Prague; latitude=50.0833; longitude=14.4667; http://maps.google.com/maps?q=50.0833,14.4667&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0BDlk0t65 - 33a4dd3d9033 - 20101021 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.73 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62795 Archived-At: ------------S1FhwgUheoAYeGUzw6p3vA Content-Type: text/plain; charset=iso-8859-2; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable Hello, I have a problem with processing a Lua file similar to that with \typefi= le described several days (weeks?) ago. Let's have the following files: - Ctx: --- \mainlanguage[cz] \enableregime[cp1250] \starttext AAA \startluacode local t =3D dofile("t.lua") context(t) \stopluacode \stoptext --- - And the t.lua: --- -- return "111" -- This worked OK return "=BE=B9=E8" -- 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 diacr= itics (like "=E8=F8=BE..."); the t.lua is not encoded in UTF-8 (which se= ems to be supposed by Ctx-Lua), but I'm using the cp1250 code page + eac= h character =3D 1 B. The error message is: --- MTXrun | run 1: luatex --fmt=3D"c:/ConTeXt/tex/texmf-cache/luatex-cache/= context/f53042fa2e1c106bc7e3383ec8c3a00c/formats/cont-en" --lua=3D"c:/Co= nTeXt/tex/texmf-cache/luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a= 00c/formats/cont-en.lui" --backend=3Dpdf "D:/L ukas/ConTeXt/Samples/U8/t-U8.mkiv"This is LuaTeX, Version beta-0.63.0-20= 10090921 (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/engli= sh 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/te= x/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/tex= mf/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 li= ne 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 =3D dofile("t.lua") 9 10 context(t) 11 \stopluacode l.1 =D7=DC=C0 } context(t)> ...le("t.lua") \dodostartluacode ...d \directlua \zerocount {#1}} l.11 \stopluacode backends > using xmp file 'c:/ConTeXt/tex/texmf-context/tex/conte= xt/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 )= mkiv lua stats : used config file - c:/ConTeXt/tex/texmf/web2c/= texmfcnf.lua mkiv lua stats : used cache path - c:/ConTeXt/tex/texmf-cache/= luatex-cache/context/f53042fa2e1c106bc7e3383ec8c3a00c mkiv lua stats : input load time - 0.094 seconds mkiv lua stats : stored bytecode data - 241 modules, 56 tables, 297= chunks mkiv lua stats : cleaned up reserved nodes - 33 nodes, 9 lists of 411 mkiv lua stats : node memory usage - 19 glue_spec mkiv lua stats : node list callback tasks - 6 unique task lists, 5 inst= ances (re)created, 328 calls mkiv lua stats : used backend - pdf (backend for directly g= enerating pdf output) mkiv lua stats : loaded patterns - cs::23 en::2 mkiv lua stats : language load time - 0.156 seconds , nofpatterns= : 2 mkiv lua stats : callbacks - direct: 480, indirect: 4507= , total: 4987 mkiv lua stats : lxml preparation time - 0.000 seconds, 0 nodes, 15 = lpath calls, 0 cached calls mkiv lua stats : result saved in file - t-U8.pdf mkiv lua stats : loaded fonts - 33 files: stmary10.afm lmmo= no12-regular.otf lmmono8-regular.otf lmmono9-regular.otf lmroman12-bold.= otf lmroman12-regular.otf lmroman7-bold.otf lmroman7-regular.otf lmroman= 9-bold.otf lmroman9-regular.otf lmsans12 -regular.otf lmsans8-regular.otf lmsans9-regular.otf eufb10.tfm eufb7.tf= m eufm10.tfm eufm7.tfm msam10.tfm msam7.tfm msbm10.tfm msbm7.tfm lmex10.= tfm lmmi12.tfm lmmi7.tfm lmmi9.tfm lmmib10.tfm lmmib7.tfm lmsy10.tfm lms= y7.tfm lmsy9.tfm rm-lmr12.tfm rm-lmr7.tf m rm-lmr9.tfm mkiv lua stats : fonts load time - 1.141 seconds mkiv lua stats : luatex banner - this is luatex, version bet= a-0.63.0-2010090921 (web2c 2010) (rev 3873) mkiv lua stats : control sequences - 30353 of 165536 mkiv lua stats : current memory usage - 33 MB (ctx: 33 MB) mkiv lua stats : runtime - 3.531 seconds, 1 processed = pages, 1 shipped pages, 0.283 pages/second --- So would it be possible to specify for Ctx which coding to use when usin= g a Lua file by 'require' or 'dofile'? - Or could this be depending on \enableregime specified in Ctx source fi= le before \startluacode? Or how to make Ctx work with non-UTF8 Lua files? Lukas NB: Latest minimals, WinXP. ------------S1FhwgUheoAYeGUzw6p3vA Content-Disposition: attachment; filename=t.lua Content-Type: application/octet-stream; name=t.lua Content-Transfer-Encoding: Base64 cmV0dXJuICKemugiIC0tIjExMSINCg== ------------S1FhwgUheoAYeGUzw6p3vA Content-Disposition: attachment; filename=t-U8.mkiv Content-Type: application/octet-stream; name=t-U8.mkiv Content-Transfer-Encoding: Base64 XG1haW5sYW5ndWFnZVtjel0KXGVuYWJsZXJlZ2ltZVtjcDEyNTBdCgpcc3RhcnR0 ZXh0CiAgQUFBCgogIFxzdGFydGx1YWNvZGUKICAgIGxvY2FsIHQgPSBkb2ZpbGUo InQubHVhIikKCiAgICBjb250ZXh0KHQpCiAgXHN0b3BsdWFjb2RlClxzdG9wdGV4 dAo= ------------S1FhwgUheoAYeGUzw6p3vA Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ ------------S1FhwgUheoAYeGUzw6p3vA--