From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74519 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 (renaming attachments to .scr_) Date: Thu, 16 Feb 2012 14:15:20 +0100 Message-ID: References: <20120210105732.GA30993@phlegethon> <667A5F7C-1EAF-451B-B3C4-8DE151A1AF44@googlemail.com> <4F3CF1A9.6030904@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=----------hCsRGFPmFZwgz79ygYNeXS X-Trace: dough.gmane.org 1329398165 6931 80.91.229.3 (16 Feb 2012 13:16:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 16 Feb 2012 13:16:05 +0000 (UTC) Cc: ConTeXt To: "Hans Hagen" Original-X-From: ntg-context-bounces@ntg.nl Thu Feb 16 14:16:00 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 1Ry1Bk-0000S9-53 for gctc-ntg-context-518@m.gmane.org; Thu, 16 Feb 2012 14:15:56 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 5CFD4CB26B; Thu, 16 Feb 2012 14:15:55 +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 1EHrVptR0q1a; Thu, 16 Feb 2012 14:15:49 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id BF1A4CB243; Thu, 16 Feb 2012 14:15:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9802ECB243 for ; Thu, 16 Feb 2012 14:15:48 +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 dI1llKJKuR4s for ; Thu, 16 Feb 2012 14:15:33 +0100 (CET) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id 454FDCB241 for ; Thu, 16 Feb 2012 14:15:33 +0100 (CET) Original-Received: from mail.pontex.cz (mail.pontex.cz [89.233.168.98]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q1GDFTpV009665 for ; Thu, 16 Feb 2012 14:15:30 +0100 Original-Received: from localhost ([127.0.0.1]) by mail.pontex.cz (Kerio MailServer 6.6.2); Thu, 16 Feb 2012 14:15:23 +0100 In-Reply-To: <4F3CF1A9.6030904@wxs.nl> 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: 07GyBftNN - 45d08933f0bf - 20120216 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 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:74519 Archived-At: ------------hCsRGFPmFZwgz79ygYNeXS Content-Type: text/plain; charset=iso-8859-2; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable On Thu, 16 Feb 2012 13:08:09 +0100, Hans Hagen wrote: > no, although it's no big deal to provide that (of course there is then= > the matter of utf being more complete than the target) > >> ---- >> src_enc =3D "utf8" >> tgt_enc =3D "cp1250" >> >> str =3D regimes.translate(str, src_enc, tgt_enc) >> ---- > > is there a reason not to stick to utf? > > Hans Well - I'm working with a .cld document (with UTF encoding). There are s= ome functions which typeset texts. And there is also a part which create= s a .scr file. .Scr files are sequences of AutoCAD commands - their contents are passed= directly to AutoCAD command prompt. When AutoCAD is creating a text entity, it reads the input stream (in ou= r case: the .scr file) BYTE-PER-BYTE. When bytes represent a text to be = drawn, unknown bytes (=3D bytes that don't have any graphical representa= tion in AutoCAD font file ("shape" file in AutoCAD's terminology)) are s= hown as "?". Of course, valid representation of language-specific-characters (like "=E8= =F8=BE..." in Czech) requires an appropriate .shx (=3D "shape compiled")= file. Anyway, when AutoCAD is to write "=E8", it requires just ONE BYTE to be = passed to it; so 2-byte UTF representation gives bad result (=3D "??"). So back to the origin, when I call the .cld's function that writes a com= mand to the .scr file, I need to convert a UTF string back to CP 1250. Would it be possible to provide this? NB: There are two examples of .scr files; CP1250.scr works well in AutoC= AD, the latter draws "????ST" instead of "=C8=C1ST". Kind reagrds, Lukas -- = Ing. Luk=E1=B9 Proch=E1zka [mailto:LPr@pontex.cz] Pontex s. r. o. [mailto:pontex@pontex.cz] [http://www.pontex.cz] Bezov=E1 1658 147 14 Praha 4 Tel: +420 244 062 238 Fax: +420 244 461 038 ------------hCsRGFPmFZwgz79ygYNeXS Content-Disposition: attachment; filename=UTF.scr_ Content-Type: application/octet-stream; name==??Q?UTF.scr=5F?= Content-Transfer-Encoding: Base64 Xy5URVhUIF9TVCBST01BTkQgX0ogX1IgX05PTiAxNC40OCwwLjA5MjUgMC4wMDcg MC4wIMSMw4FTVA0K ------------hCsRGFPmFZwgz79ygYNeXS Content-Disposition: attachment; filename=CP1250.scr_ Content-Type: application/octet-stream; name==??Q?CP1250.scr=5F?= Content-Transfer-Encoding: Base64 Xy5URVhUIF9TVCBST01BTkQgX0ogX1IgX05PTiAxNC40OCwwLjA5MjUgMC4wMDcg MC4wIMjBU1QNCg== ------------hCsRGFPmFZwgz79ygYNeXS 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 ___________________________________________________________________________________ ------------hCsRGFPmFZwgz79ygYNeXS--