From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74419 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: UTF conversion via Lua Date: Fri, 10 Feb 2012 13:25:40 +0100 Message-ID: <667A5F7C-1EAF-451B-B3C4-8DE151A1AF44@googlemail.com> References: <20120210105732.GA30993@phlegethon> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1328876765 7341 80.91.229.3 (10 Feb 2012 12:26:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 12:26:05 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 10 13:26:03 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RvpYB-0005IZ-BX for gctc-ntg-context-518@m.gmane.org; Fri, 10 Feb 2012 13:26:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B0DCFCB206; Fri, 10 Feb 2012 13:26:02 +0100 (CET) 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 nLcbhk5BQnaR; Fri, 10 Feb 2012 13:26:00 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3FDA4CB1ED; Fri, 10 Feb 2012 13:26:00 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 256CFCB1ED for ; Fri, 10 Feb 2012 13:25:59 +0100 (CET) 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 9OJXhWOgiaRw for ; Fri, 10 Feb 2012 13:25:44 +0100 (CET) Original-Received: from filter3-ams.mf.surf.net (filter3-ams.mf.surf.net [192.87.102.71]) by balder.ntg.nl (Postfix) with ESMTP id 80EEBCABBD for ; Fri, 10 Feb 2012 13:25:44 +0100 (CET) Original-Received: from mail-ey0-f169.google.com (mail-ey0-f169.google.com [209.85.215.169]) by filter3-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1ACPhf1007526 for ; Fri, 10 Feb 2012 13:25:44 +0100 Original-Received: by eaag11 with SMTP id g11so1045928eaa.14 for ; Fri, 10 Feb 2012 04:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=r1qtT4NaQdOonpMCnbfU5rjCrfSNCVFalzOb/t2foUM=; b=DtaokVXIYUTd0dRfkxf21TVuEP+ljXYkLBm/hPG+oL5usfzfl8hBW+tCT47tyUc7G8 g4fGshvCYpZDk2lo2sXRCDI4L7BuQWqffizLV1Nx0WGkRqFZsNaRdopvz9UlINXhtfHr helBj7gfXgSqQl9AYB3gzBmju/c/OnYiUL46o= Original-Received: by 10.14.186.134 with SMTP id w6mr1933338eem.96.1328876743729; Fri, 10 Feb 2012 04:25:43 -0800 (PST) Original-Received: from [192.168.2.35] (p57AFAEE9.dip.t-dialin.net. [87.175.174.233]) by mx.google.com with ESMTPS id n56sm21596626eeh.6.2012.02.10.04.25.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Feb 2012 04:25:42 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1257) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.215.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0cGwcpHjV - 977b1e0fc1fa - 20120210 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.71 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:74419 Archived-At: Am 10.02.2012 um 12:32 schrieb Proch=E1zka Luk=E1=9A 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 =3D assert(io.open(fn, "r")) > local str =3D 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 =93regimes.translate=94 in your code but it= =92s better to ask Hans for a function in the commands namespace which you can use. \starttext \startluacode function loadFile(fn) local fh =3D assert(io.open(fn, "r")) local str =3D fh:read("*all") fh:close() str =3D regimes.translate(str,"cp1250") context(str) end loadFile("a.txt") \stopluacode \stoptext Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________