Am 10.02.2012 um 12:32 schrieb Procházka Lukáš Ing. - Pontex s. r. o.:
... \enableregime - nice idea!
Despite this, I'm still not able to make work the example:
---- Test.mkiv \enableregime[cp1250]
\starttext \startluacode function loadFile(fn) local fh = assert(io.open(fn, "r")) local str = fh:read("*all")
fh:close()
return str end
context.startregime{"cp1250"} context(loadFile("a.txt")) context.stopregime() \stopluacode \stoptext ----
Where's the problem?
Dunno but it works when you use “regimes.translate” in your code but it’s better to ask Hans for a function in the commands namespace which you can use. \starttext \startluacode function loadFile(fn) local fh = assert(io.open(fn, "r")) local str = fh:read("*all") fh:close() str = regimes.translate(str,"cp1250") context(str) end loadFile("a.txt") \stopluacode \stoptext Wolfgang