From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74416 Path: news.gmane.org!not-for-mail From: =?iso-8859-2?B?UHJvY2jhemthIEx1a+G5IEluZy4gLSBQb250ZXggcy4gci4gby4=?= Newsgroups: gmane.comp.tex.context Subject: Re: UTF conversion via Lua Date: Fri, 10 Feb 2012 12:32:22 +0100 Message-ID: References: <20120210105732.GA30993@phlegethon> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=----------1jNhNh6t9mCiA0YteyvRET X-Trace: dough.gmane.org 1328873560 15978 80.91.229.3 (10 Feb 2012 11:32:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 10 Feb 2012 11:32:40 +0000 (UTC) To: "mailing list for ConTeXt users" Original-X-From: ntg-context-bounces@ntg.nl Fri Feb 10 12:32:36 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 1RvoiR-0006XF-Qe for gctc-ntg-context-518@m.gmane.org; Fri, 10 Feb 2012 12:32:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 82D4BCB1ED; Fri, 10 Feb 2012 12:32:35 +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 CH3Ak7R1lwBU; Fri, 10 Feb 2012 12:32:29 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DE2E0CABBD; Fri, 10 Feb 2012 12:32:29 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0BFB9CAB03 for ; Fri, 10 Feb 2012 12:32:29 +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 nDbXidW7c9uh for ; Fri, 10 Feb 2012 12:32:27 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id 02C06CABBD for ; Fri, 10 Feb 2012 12:32:27 +0100 (CET) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1ABWPGg032252 for ; Fri, 10 Feb 2012 12:32:26 +0100 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2) for ntg-context@ntg.nl; Fri, 10 Feb 2012 12:32:23 +0100 In-Reply-To: User-Agent: Opera Mail/11.61 (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: 03GwbwqMw - bac98ee549da - 20120210 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 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:74416 Archived-At: ------------1jNhNh6t9mCiA0YteyvRET Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable ... \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? Lukas On Fri, 10 Feb 2012 12:15:29 +0100, Wolfgang Schuster wrote: > > Am 10.02.2012 um 12:11 schrieb Proch=C3=A1zka Luk=C3=A1=C5=A1 Ing. - P= ontex s. r. o.: > >> ... Well, my information was not correct. >> >> There are characters > 127 in the file, like "=C5=99", "=C5=A1"... >> >> Each char =3D 1 byte, and as I'm using Windows with CP 1250, the char= acters are displayed correctly. >> >> But I have problem loading them into ConTeXt. >> >> I need to convert the bytes > 127 to UTF sequence, which would be acc= eptable by ConTeXt. >> >> @Thomas: >> >> The table looks nice but there are no entries for CP 1250 to UTF conv= ersion. >> >> I prepared some tables: character conversion and removal of diacritic= s (see the attachment); >> maybe it would be handful to include them into ConTeXt somehow. > > Why don=E2=80=99t you let do context the conversion: > > \starttext > > this is something in utf8 > > \startregime[cp1250] > \input filewithcp1250encoding > \stopregime > > more text encoded in utf8 > > \stoptext > > Wolfgang > ______________________________________________________________________= _____________ > 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 > ______________________________________________________________________= _____________ -- = Ing. Luk=C3=A1=C5=A1 Proch=C3=A1zka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezov=C3=A1 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ------------1jNhNh6t9mCiA0YteyvRET Content-Disposition: attachment; filename=a.txt Content-Type: text/plain; name="a.txt" Content-Transfer-Encoding: Base64 YWJjDQqe/Q0K ------------1jNhNh6t9mCiA0YteyvRET Content-Disposition: attachment; filename=Test.mkiv Content-Type: application/octet-stream; name="Test.mkiv" Content-Transfer-Encoding: Base64 XGVuYWJsZXJlZ2ltZVtjcDEyNTBdDQoNClxzdGFydHRleHQNCiAgXHN0YXJ0bHVh Y29kZQ0KICAgIGZ1bmN0aW9uIGxvYWRGaWxlKGZuKQ0KICAgICAgbG9jYWwgZmgg PSBhc3NlcnQoaW8ub3BlbihmbiwgInIiKSkNCiAgICAgIGxvY2FsIHN0ciA9IGZo OnJlYWQoIiphbGwiKQ0KDQogICAgICBmaDpjbG9zZSgpDQoNCiAgICAgIHJldHVy biBzdHINCiAgICBlbmQNCg0KICAgIGNvbnRleHQuc3RhcnRyZWdpbWV7ImNwMTI1 MCJ9DQogICAgICBjb250ZXh0KGxvYWRGaWxlKCJhLnR4dCIpKQ0KICAgIGNvbnRl eHQuc3RvcHJlZ2ltZSgpDQogIFxzdG9wbHVhY29kZQ0KXHN0b3B0ZXh0DQo= ------------1jNhNh6t9mCiA0YteyvRET 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 ___________________________________________________________________________________ ------------1jNhNh6t9mCiA0YteyvRET--