From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/52148 Path: news.gmane.org!not-for-mail From: Jose Augusto Newsgroups: gmane.comp.tex.context Subject: Ruby 1.9.1 and non-ascii char parsing in .tui file Date: Sat, 8 Aug 2009 20:16:10 +0100 Message-ID: <1781d7210908081216n46c62018kb3a5f14643afb396@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0518560257==" X-Trace: ger.gmane.org 1249758992 27310 80.91.229.12 (8 Aug 2009 19:16:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Aug 2009 19:16:32 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Aug 08 21:16:25 2009 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.50) id 1MZrOz-0006nl-I9 for gctc-ntg-context-518@m.gmane.org; Sat, 08 Aug 2009 21:16:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id ADC69C9BA1; Sat, 8 Aug 2009 21:16:22 +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 qAVCYPAw8Oh8; Sat, 8 Aug 2009 21:16:16 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8820FC9B41; Sat, 8 Aug 2009 21:16:16 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B86AAC9B41 for ; Sat, 8 Aug 2009 21:16:15 +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 4CM1AhLXUJG2 for ; Sat, 8 Aug 2009 21:16:10 +0200 (CEST) Original-Received: from mail-bw0-f207.google.com (mail-bw0-f207.google.com [209.85.218.207]) by balder.ntg.nl (Postfix) with ESMTP id 9AB39C9ADD for ; Sat, 8 Aug 2009 21:16:10 +0200 (CEST) Original-Received: by bwz3 with SMTP id 3so2005664bwz.2 for ; Sat, 08 Aug 2009 12:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=1a7LrNRSD6zUpJD3sq1UkEKVSMMYWqt/U8vVL+gAPbg=; b=mmnp0MIZnQutH4ib6A6F05vf3gt9tacmMGxy0Sar+UIWAw60AcugyA6B16vLkWcESS VxOV3aCAf2ySRD5rHCUMe2zItomCjwqystiDXqCmk6V9NRRXMkjiYREomqAA2aj77LT2 xvPt0/GcXEbwdYI2bKzM2/0y5sI58jaFAz0nE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=tJwsPwxC60KJm5xAM5D5Dcv8AIm0JQ7pfZMhUy3sf874r49userv9YRUprPDFocEN8 qm9F5XPoa6f6phsKmSaynF7vCORjNdJ6kDeq/7kDjAqS79gBhjafHizE1ZkQWQuejo2/ oGQS02F3dnZHcskFw1Q9CpsQ7aWynznN/s8gI= Original-Received: by 10.223.108.84 with SMTP id e20mr537457fap.58.1249758970190; Sat, 08 Aug 2009 12:16:10 -0700 (PDT) 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:52148 Archived-At: --===============0518560257== Content-Type: multipart/alternative; boundary=001636c5a398791c170470a62f85 --001636c5a398791c170470a62f85 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all, A few weeks ago I reported a problem with ruby 1.9.1, which was solved by removing the offending .tui line (Mojca and Hans AFAIR). The problem was related with the existence of non-ascii chars in the .tui file. Sadly it strikes again, now when chars with accents appear in titles (sections, subsections, etc...). The parsing of the line signaled below in the end of this message, from a .tui file, fails in ruby 1.9.1, but not in ruby 1.8.7. The error which is returned is also shown. If I remove the chars with accents from the section title all goes well. I'= m using Mkii (--context=3Dcurrent). One of the advantages of ruby 1.8 over 1.8 is tht it is 3 times faster... However, ruby made lots of changes in string manipulation and storing when moving from 1.8 to 1.9, and that must be the source of the problem. I tracked the error to texutil.rb, line 1035: when /^c (.*)$/o then @plugins.reader('MyCommands', [$1]) but then i got lost in the Classes/Modules jungle :-) in that script. Perhaps it is this this procedure, in line 403 of texutil.rb, which trigger= s the error? def MyCommands::reader(logger,data) @@commands.push(data.shift+data.collect do |d| "\{#{d}\}" end.join) end Thx for your support in advance. If I can help in the solution of the problem please direct me in the task. = I have some experience with ruby (I started using it when the 1st pickaxe book edition was published, around 2001) and with perl. But not with Lua :-)... Although I read alraedy quite a lot of Roberto's Lua book, I didn't started coding in Lua yet :-) Kind Regards J. Augusto ############## TUI file and trigered error ################### ## .tui snippet ........ c \mainreference{}{a}{2--0-1-1-0-0-0-0--1}{1}{1.1} >>>>>> c \listentry{subsection}{3}{1.1.1}{Title with accents: =C3=E7=EA}{2--0-1-1-1-0-0-0--1}{1} c \mainreference{}{b}{2--0-1-1-1-0-0-0--1}{1}{1.2} ### error pdfTeX warning: pdftex.exe: no GlyphToUnicode entry has been inserted yet! Output written on test1.pdf (1 page, 72793 bytes). Transcript written on test1.log. TeXUtil | parsing file test1.tui TeXUtil | fatal error in parsing test1.tui TeXUtil | check loading of file 'test1', begin/end problem TeXUtil | shortcuts : 169 TeXUtil | expansions: 308 ############################# --001636c5a398791c170470a62f85 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,

A few weeks ago I reported a problem with ruby 1.9.1, which<= br>was solved by removing the offending .tui line (Mojca and Hans
AFAIR)= . The problem was related with the existence of non-ascii
chars in the .= tui file. Sadly it strikes again, now when chars with
accents appear in titles (sections, subsections, etc...).

The=A0 pa= rsing of the line signaled below in the end of this message, from a .tui fi= le,
fails in ruby 1.9.1, but not in ruby 1.8.7. The error which is retu= rned is also shown.
If I remove the chars with accents from the section title all goes well. I&= #39;m using
Mkii (--context=3Dcurrent).

One of=A0 the advantages= of ruby 1.8 over 1.8 is tht it is 3 times faster...
However, ruby made = lots of changes in string manipulation and storing
when moving from 1.8 to 1.9, and that must be the source of the problem.
I tracked the error to texutil.rb, line 1035:

=A0=A0=A0=A0=A0=A0=A0 when /^c (.*)$/o then @plugins.reader('MyComm= ands', [$1])

but then i got lost in the Classes/Modules jungle :-) in that script.
Perhaps it is this this procedure, in line 403 of texutil.rb, which trigger= s the error?

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 def MyCommands::reader(logger,data)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 @@commands.push(data.shift+da= ta.collect do |d| "\{#{d}\}" end.join)
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 end

Thx for your support in advance.
=A0
If I can help in the solution of= the problem please direct me in the task. I have some
experience with r= uby (I started using it when the 1st pickaxe book edition was
published= , around 2001) and with perl. But not with Lua :-)... Although I read
alraedy quite a lot of Roberto's Lua book, I didn't started coding = in Lua yet :-)

Kind Regards

J. Augusto

##############= =A0=A0=A0 TUI file and trigered error =A0 ###################

## .tu= i snippet
........
c \mainreference{}{a}{2--0-1-1-0-0-0-0--1}{1}{1.1}
>>&= gt;>>>=A0 =A0=A0=A0=A0=A0 c \listentry{subsection}{3}{1.1.1}{Title= with accents: =C3=E7=EA}{2--0-1-1-1-0-0-0--1}{1}
c \mainreference{}{b}{= 2--0-1-1-1-0-0-0--1}{1}{1.2}

### error

pdfTeX warning: pdftex.exe: no GlyphToUnicode entry h= as been inserted yet!
Output written on test1.pdf (1 page, 72793 bytes).=
Transcript written on test1.log.
TeXUtil | parsing file test1.tui TeXUtil | fatal error in parsing test1.tui
TeXUtil | check loading of fi= le 'test1', begin/end problem
TeXUtil | shortcuts : 169
TeXUt= il | expansions: 308
#############################


--001636c5a398791c170470a62f85-- --===============0518560257== 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============0518560257==--