ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Ruby 1.9.1 and non-ascii char parsing in .tui file
@ 2009-08-08 19:16 Jose Augusto
  2009-08-09 19:57 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Augusto @ 2009-08-08 19:16 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2385 bytes --]

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=current).

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 triggers
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:
Ãçê}{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
#############################

[-- Attachment #1.2: Type: text/html, Size: 2607 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-08 19:16 Ruby 1.9.1 and non-ascii char parsing in .tui file Jose Augusto
@ 2009-08-09 19:57 ` Hans Hagen
  2009-08-10  3:15   ` Jose Augusto
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2009-08-09 19:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jose Augusto wrote:

>         when /^c (.*)$/o then @plugins.reader('MyCommands', [$1])

what if you remove the o (/o)

can you find out what changed between 1.8 and 1.9 ... actually 1.9 is 
the stepping stone to 2.0 and 2 versions can be incompatible to 1 versions

also, can you make a test file so that we can see if there's a platform 
dependency?


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-09 19:57 ` Hans Hagen
@ 2009-08-10  3:15   ` Jose Augusto
  2009-08-10 13:10     ` Hans Hagen
  2009-08-10 15:15     ` Jose Augusto
  0 siblings, 2 replies; 11+ messages in thread
From: Jose Augusto @ 2009-08-10  3:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3553 bytes --]

Hi all,

Ok, here it goes. Atached are the files used in the test.

The problem as reported in the >> previous email << used
the file with the offending chars wrapped in a main file, which was just:

\starttext
\input zzz.tex
\stoptext

That is, the offending chars were in zzz.tex.

In that example I noticed the error because the cross-refs
in the equation numbering were not working.
The parsing of the .tui file by ruby 1.9.1 failed. Then I saw the errors.

But then I made >> a single context file <<, which goes attached
with the correct results (tui, tuo, pdf), obtained with ruby 1.8.7.

Howver, when i run ruby 1.9.1 with patch 129 (the last one), in this
single tex file (attached) now the first pass don't work!
Here is the result (in windows xp), which proves ruby 1.9.1 doesn't like
the non US-ASCII chars :-)

F:\ANOS\ano09-10-pen\NotasProcSinal>texexec test1.tex
TeXExec | processing document 'test1.tex'
TeXExec | no ctx file found
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:946:in `===':
invalid byte sequence in US-ASCII (ArgumentError)
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:946: in
`scantexcontent'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1907: in
`processfile'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1143: in
`block (2 levels) in processtex'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1133: in
`timedrun'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1142: in
`block in processtex'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1139: in
`each'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1139: in
`processtex'
        from
D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:63:in`process'
        from
D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:53:in `main'
        from
D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/switch.rb:133:in
`execute'
        from
D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:787:in `<main>'

Thanks all for your interest,

Kind regards

J. Augusto

On Sun, Aug 9, 2009 at 8:57 PM, Hans Hagen <pragma@wxs.nl> wrote:

> Jose Augusto wrote:
>
>         when /^c (.*)$/o then @plugins.reader('MyCommands', [$1])
>>
>
> what if you remove the o (/o)
>
> can you find out what changed between 1.8 and 1.9 ... actually 1.9 is the
> stepping stone to 2.0 and 2 versions can be incompatible to 1 versions
>
> also, can you make a test file so that we can see if there's a platform
> dependency?
>
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 4795 bytes --]

[-- Attachment #2: test11-ruby187-p174.tui --]
[-- Type: application/octet-stream, Size: 12397 bytes --]

c \thisissectionseparator{-}
c \thisisutilityversion{2008.10.14}
f b {test1}
c \usedmapfile{=}{original-base}
c \usedmapfile{=}{original-ams-base}
c \usedmapfile{=}{original-public-lm}
c \usedmapfile{=}{lm-ec}
c \usedmapfile{=}{lm-math}
c \usedmapfile{=}{lm-rm}
c \usedmapfile{=}{original-ams-euler}
c \initializevariable\usedoutputdriver{pdftex}
x e {} {aeligature} {ae}
x e {} {AEligature} {AE}
x e {} {ijligature} {ij}
x e {} {IJligature} {IJ}
x e {} {oeligature} {oe}
x e {} {OEligature} {OE}
x e {} {ssharp} {ss}
x e {} {Ssharp} {SS}
x e {} {thorn} {}
x e {} {Thorn} {}
x e {} {eth} {}
x e {} {Eth} {}
x e {} {dj} {dstroke}
x e {} {Dj} {Dstroke}
x e {} {Acircumflex} {}
x e {} {acircumflex} {}
x e {} {Ccircumflex} {}
x e {} {ccircumflex} {}
x e {} {Ecircumflex} {}
x e {} {ecircumflex} {}
x e {} {Gcircumflex} {}
x e {} {gcircumflex} {}
x e {} {Hcircumflex} {}
x e {} {hcircumflex} {}
x e {} {Icircumflex} {}
x e {} {icircumflex} {}
x e {} {Jcircumflex} {}
x e {} {jcircumflex} {}
x e {} {Ocircumflex} {}
x e {} {ocircumflex} {}
x e {} {Scircumflex} {}
x e {} {scircumflex} {}
x e {} {Ucircumflex} {}
x e {} {ucircumflex} {}
x e {} {Wcircumflex} {}
x e {} {wcircumflex} {}
x e {} {Ycircumflex} {}
x e {} {ycircumflex} {}
x e {} {Agrave} {}
x e {} {agrave} {}
x e {} {Egrave} {}
x e {} {egrave} {}
x e {} {Igrave} {}
x e {} {igrave} {}
x e {} {Ograve} {}
x e {} {ograve} {}
x e {} {Ugrave} {}
x e {} {ugrave} {}
x e {} {Ygrave} {}
x e {} {ygrave} {}
x e {} {Atilde} {}
x e {} {atilde} {}
x e {} {Itilde} {}
x e {} {itilde} {}
x e {} {Ntilde} {}
x e {} {ntilde} {}
x e {} {Otilde} {}
x e {} {otilde} {}
x e {} {Utilde} {}
x e {} {utilde} {}
x e {} {Ytilde} {}
x e {} {ytilde} {}
x e {} {Adiaeresis} {}
x e {} {adiaeresis} {}
x e {} {Ediaeresis} {}
x e {} {ediaeresis} {}
x e {} {Idiaeresis} {}
x e {} {idiaeresis} {}
x e {} {Odiaeresis} {}
x e {} {odiaeresis} {}
x e {} {Udiaeresis} {}
x e {} {udiaeresis} {}
x e {} {Ydiaeresis} {}
x e {} {ydiaeresis} {}
x e {} {Aacute} {}
x e {} {aacute} {}
x e {} {Cacute} {}
x e {} {cacute} {}
x e {} {Eacute} {}
x e {} {eacute} {}
x e {} {Iacute} {}
x e {} {iacute} {}
x e {} {Lacute} {}
x e {} {lacute} {}
x e {} {Nacute} {}
x e {} {nacute} {}
x e {} {Oacute} {}
x e {} {oacute} {}
x e {} {Racute} {}
x e {} {racute} {}
x e {} {Sacute} {}
x e {} {sacute} {}
x e {} {Uacute} {}
x e {} {uacute} {}
x e {} {Yacute} {}
x e {} {yacute} {}
x e {} {Zacute} {}
x e {} {zacute} {}
x e {} {dstroke} {}
x e {} {Dstroke} {}
x e {} {Hstroke} {}
x e {} {hstroke} {}
x e {} {Tstroke} {}
x e {} {tstroke} {}
x e {} {Cdotaccent} {}
x e {} {cdotaccent} {}
x e {} {Edotaccent} {}
x e {} {edotaccent} {}
x e {} {Gdotaccent} {}
x e {} {gdotaccent} {}
x e {} {Idotaccent} {}
x e {} {idotaccent} {}
x e {} {Zdotaccent} {}
x e {} {zdotaccent} {}
x e {} {Amacron} {}
x e {} {amacron} {}
x e {} {Emacron} {}
x e {} {emacron} {}
x e {} {Imacron} {}
x e {} {imacron} {}
x e {} {Omacron} {}
x e {} {omacron} {}
x e {} {Umacron} {}
x e {} {umacron} {}
x e {} {Ccedilla} {}
x e {} {ccedilla} {}
x e {} {Kcedilla} {}
x e {} {kcedilla} {}
x e {} {Lcedilla} {}
x e {} {lcedilla} {}
x e {} {Ncedilla} {}
x e {} {ncedilla} {}
x e {} {Rcedilla} {}
x e {} {rcedilla} {}
x e {} {Scedilla} {}
x e {} {scedilla} {}
x e {} {Tcedilla} {}
x e {} {tcedilla} {}
x e {} {Ohungarumlaut} {}
x e {} {ohungarumlaut} {}
x e {} {Uhungarumlaut} {}
x e {} {uhungarumlaut} {}
x e {} {Aogonek} {}
x e {} {aogonek} {}
x e {} {Eogonek} {}
x e {} {eogonek} {}
x e {} {Iogonek} {}
x e {} {iogonek} {}
x e {} {Uogonek} {}
x e {} {uogonek} {}
x e {} {Aring} {}
x e {} {aring} {}
x e {} {Uring} {}
x e {} {uring} {}
x e {} {Abreve} {}
x e {} {abreve} {}
x e {} {Ebreve} {}
x e {} {ebreve} {}
x e {} {Gbreve} {}
x e {} {gbreve} {}
x e {} {Ibreve} {}
x e {} {ibreve} {}
x e {} {Obreve} {}
x e {} {obreve} {}
x e {} {Ubreve} {}
x e {} {ubreve} {}
x e {} {Ccaron} {}
x e {} {ccaron} {}
x e {} {Dcaron} {}
x e {} {dcaron} {}
x e {} {Ecaron} {}
x e {} {ecaron} {}
x e {} {Lcaron} {}
x e {} {lcaron} {}
x e {} {Ncaron} {}
x e {} {ncaron} {}
x e {} {Rcaron} {}
x e {} {rcaron} {}
x e {} {Scaron} {}
x e {} {scaron} {}
x e {} {Tcaron} {}
x e {} {tcaron} {}
x e {} {Ycaron} {}
x e {} {ycaron} {}
x e {} {Zcaron} {}
x e {} {zcaron} {}
x e {} {Lstroke} {}
x e {} {lstroke} {}
x e {} {Ostroke} {}
x e {} {ostroke} {}
x e {} {aumlaut} {}
x e {} {eumlaut} {}
x e {} {iumlaut} {}
x e {} {oumlaut} {}
x e {} {uumlaut} {}
x e {} {Aumlaut} {}
x e {} {Eumlaut} {}
x e {} {Iumlaut} {}
x e {} {Oumlaut} {}
x e {} {Uumlaut} {}
x e {} {scommaaccent} {}
x e {} {Scommaaccent} {}
x e {} {tcommaaccent} {}
x e {} {Tcommaaccent} {}
x e {} {Etilde} {}
x e {} {etilde} {}
x e {} {Ahook} {}
x e {} {ahook} {}
x e {} {Ehook} {}
x e {} {ehook} {}
x e {} {Ihook} {}
x e {} {ihook} {}
x e {} {Ohook} {}
x e {} {ohook} {}
x e {} {Uhook} {}
x e {} {uhook} {}
x e {} {Yhook} {}
x e {} {yhook} {}
x e {} {Acircumflexgrave} {}
x e {} {Acircumflexacute} {}
x e {} {Acircumflextilde} {}
x e {} {Acircumflexhook} {}
x e {} {acircumflexgrave} {}
x e {} {acircumflexacute} {}
x e {} {acircumflextilde} {}
x e {} {acircumflexhook} {}
x e {} {Ecircumflexgrave} {}
x e {} {Ecircumflexacute} {}
x e {} {Ecircumflextilde} {}
x e {} {Ecircumflexhook} {}
x e {} {ecircumflexgrave} {}
x e {} {ecircumflexacute} {}
x e {} {ecircumflextilde} {}
x e {} {ecircumflexhook} {}
x e {} {Ocircumflexgrave} {}
x e {} {Ocircumflexacute} {}
x e {} {Ocircumflextilde} {}
x e {} {Ocircumflexhook} {}
x e {} {ocircumflexgrave} {}
x e {} {ocircumflexacute} {}
x e {} {ocircumflextilde} {}
x e {} {ocircumflexhook} {}
x e {} {Abrevegrave} {}
x e {} {Abreveacute} {}
x e {} {Abrevetilde} {}
x e {} {Abrevehook} {}
x e {} {abrevegrave} {}
x e {} {abreveacute} {}
x e {} {abrevetilde} {}
x e {} {abrevehook} {}
x e {} {Adotbelow} {}
x e {} {adotbelow} {}
x e {} {Edotbelow} {}
x e {} {edotbelow} {}
x e {} {Idotbelow} {}
x e {} {idotbelow} {}
x e {} {Odotbelow} {}
x e {} {odotbelow} {}
x e {} {Udotbelow} {}
x e {} {udotbelow} {}
x e {} {Ydotbelow} {}
x e {} {ydotbelow} {}
x e {} {Ohorndotbelow} {}
x e {} {ohorndotbelow} {}
x e {} {Uhorndotbelow} {}
x e {} {uhorndotbelow} {}
x e {} {Acircumflexdotbelow} {}
x e {} {acircumflexdotbelow} {}
x e {} {Ecircumflexdotbelow} {}
x e {} {ecircumflexdotbelow} {}
x e {} {Ocircumflexdotbelow} {}
x e {} {ocircumflexdotbelow} {}
x e {} {Abrevedotbelow} {}
x e {} {abrevedotbelow} {}
x e {} {Ohorn} {}
x e {} {Ohorngrave} {}
x e {} {Ohornacute} {}
x e {} {Ohorntilde} {}
x e {} {Ohornhook } {}
x e {} {ohorn} {}
x e {} {ohorngrave} {}
x e {} {ohornacute} {}
x e {} {ohorntilde} {}
x e {} {ohornhook } {}
x e {} {Uhorn} {}
x e {} {Uhorngrave} {}
x e {} {Uhornacute} {}
x e {} {Uhorntilde} {}
x e {} {Uhornhook } {}
x e {} {uhorn} {}
x e {} {uhorngrave} {}
x e {} {uhornacute} {}
x e {} {uhorntilde} {}
x e {} {uhornhook} {}
x e {} {eszett} {ssharp}
x e {} {Eszett} {Ssharp}
x e {} {lslash} {lstroke}
x e {} {Lslash} {Lstroke}
x e {} {dslash} {dstroke}
x e {} {Dslash} {Dstroke}
x e {} {oslash} {ostroke}
x e {} {Oslash} {Ostroke}
x e {} {dcroat} {dstroke}
x e {} {Dcroat} {Dstroke}
x s {} {\^ A} {\Acircumflex }
x s {} {\^ a} {\acircumflex }
x s {} {\^ C} {\Ccircumflex }
x s {} {\^ c} {\ccircumflex }
x s {} {\^ E} {\Ecircumflex }
x s {} {\^ e} {\ecircumflex }
x s {} {\^ G} {\Gcircumflex }
x s {} {\^ g} {\gcircumflex }
x s {} {\^ H} {\Hcircumflex }
x s {} {\^ h} {\hcircumflex }
x s {} {\^ I} {\Icircumflex }
x s {} {\^ i} {\icircumflex }
x s {} {\^\i } {\icircumflex }
x s {} {\^ J} {\Jcircumflex }
x s {} {\^ j} {\jcircumflex }
x s {} {\^\j } {\jcircumflex }
x s {} {\^ O} {\Ocircumflex }
x s {} {\^ o} {\ocircumflex }
x s {} {\^ S} {\Scircumflex }
x s {} {\^ s} {\scircumflex }
x s {} {\^ U} {\Ucircumflex }
x s {} {\^ u} {\ucircumflex }
x s {} {\^ W} {\Wcircumflex }
x s {} {\^ w} {\wcircumflex }
x s {} {\^ Y} {\Ycircumflex }
x s {} {\^ y} {\ycircumflex }
x s {} {\` A} {\Agrave }
x s {} {\` a} {\agrave }
x s {} {\` E} {\Egrave }
x s {} {\` e} {\egrave }
x s {} {\` I} {\Igrave }
x s {} {\` i} {\igrave }
x s {} {\`\i } {\igrave }
x s {} {\` O} {\Ograve }
x s {} {\` o} {\ograve }
x s {} {\` U} {\Ugrave }
x s {} {\` u} {\ugrave }
x s {} {\` Y} {\Ygrave }
x s {} {\` y} {\ygrave }
x s {} {\~ A} {\Atilde }
x s {} {\~ a} {\atilde }
x s {} {\~ I} {\Itilde }
x s {} {\~ i} {\itilde }
x s {} {\~\i } {\itilde }
x s {} {\~ O} {\Otilde }
x s {} {\~ o} {\otilde }
x s {} {\~ U} {\Utilde }
x s {} {\~ u} {\utilde }
x s {} {\" A} {\Adiaeresis }
x s {} {\" a} {\adiaeresis }
x s {} {\" E} {\Ediaeresis }
x s {} {\" e} {\ediaeresis }
x s {} {\" I} {\Idiaeresis }
x s {} {\" i} {\idiaeresis }
x s {} {\"\i } {\idiaeresis }
x s {} {\" O} {\Odiaeresis }
x s {} {\" o} {\odiaeresis }
x s {} {\" U} {\Udiaeresis }
x s {} {\" u} {\udiaeresis }
x s {} {\" Y} {\Ydiaeresis }
x s {} {\" y} {\ydiaeresis }
x s {} {\' A} {\Aacute }
x s {} {\' a} {\aacute }
x s {} {\' C} {\Cacute }
x s {} {\' c} {\cacute }
x s {} {\' E} {\Eacute }
x s {} {\' e} {\eacute }
x s {} {\' I} {\Iacute }
x s {} {\' i} {\iacute }
x s {} {\'\i } {\iacute }
x s {} {\' L} {\Lacute }
x s {} {\' l} {\lacute }
x s {} {\' N} {\Nacute }
x s {} {\' n} {\nacute }
x s {} {\' O} {\Oacute }
x s {} {\' o} {\oacute }
x s {} {\' R} {\Racute }
x s {} {\' r} {\racute }
x s {} {\' S} {\Sacute }
x s {} {\' s} {\sacute }
x s {} {\' U} {\Uacute }
x s {} {\' u} {\uacute }
x s {} {\' Y} {\Yacute }
x s {} {\' y} {\yacute }
x s {} {\' Z} {\Zacute }
x s {} {\' z} {\zacute }
x s {} {\. C} {\Cdotaccent }
x s {} {\. c} {\cdotaccent }
x s {} {\. E} {\Edotaccent }
x s {} {\. e} {\edotaccent }
x s {} {\. G} {\Gdotaccent }
x s {} {\. g} {\gdotaccent }
x s {} {\. I} {\Idotaccent }
x s {} {\. i} {\idotaccent }
x s {} {\.\i } {\idotaccent }
x s {} {\. Z} {\Zdotaccent }
x s {} {\. z} {\zdotaccent }
x s {} {\= A} {\Amacron }
x s {} {\= a} {\amacron }
x s {} {\= E} {\Emacron }
x s {} {\= e} {\emacron }
x s {} {\= I} {\Imacron }
x s {} {\= i} {\imacron }
x s {} {\=\i } {\imacron }
x s {} {\= O} {\Omacron }
x s {} {\= o} {\omacron }
x s {} {\= U} {\Umacron }
x s {} {\= u} {\umacron }
x s {} {\c C} {\Ccedilla }
x s {} {\c c} {\ccedilla }
x s {} {\c K} {\Kcedilla }
x s {} {\c k} {\kcedilla }
x s {} {\c L} {\Lcedilla }
x s {} {\c l} {\lcedilla }
x s {} {\c N} {\Ncedilla }
x s {} {\c n} {\ncedilla }
x s {} {\c R} {\Rcedilla }
x s {} {\c r} {\rcedilla }
x s {} {\c S} {\Scedilla }
x s {} {\c s} {\scedilla }
x s {} {\c T} {\Tcedilla }
x s {} {\c t} {\tcedilla }
x s {} {\H O} {\Ohungarumlaut }
x s {} {\H o} {\ohungarumlaut }
x s {} {\H u} {\uhungarumlaut }
x s {} {\H U} {\Uhungarumlaut }
x s {} {\k A} {\Aogonek }
x s {} {\k a} {\aogonek }
x s {} {\k E} {\Eogonek }
x s {} {\k e} {\eogonek }
x s {} {\k I} {\Iogonek }
x s {} {\k i} {\iogonek }
x s {} {\k U} {\Uogonek }
x s {} {\k u} {\uogonek }
x s {} {\r A} {\Aring }
x s {} {\r a} {\aring }
x s {} {\r U} {\Uring }
x s {} {\r u} {\uring }
x s {} {\u A} {\Abreve }
x s {} {\u a} {\abreve }
x s {} {\u E} {\Ebreve }
x s {} {\u e} {\ebreve }
x s {} {\u G} {\Gbreve }
x s {} {\u g} {\gbreve }
x s {} {\u I} {\Ibreve }
x s {} {\u i} {\ibreve }
x s {} {\u \i } {\ibreve }
x s {} {\u O} {\Obreve }
x s {} {\u o} {\obreve }
x s {} {\u U} {\Ubreve }
x s {} {\u u} {\ubreve }
x s {} {\v C} {\Ccaron }
x s {} {\v c} {\ccaron }
x s {} {\v D} {\Dcaron }
x s {} {\v d} {\dcaron }
x s {} {\v E} {\Ecaron }
x s {} {\v e} {\ecaron }
x s {} {\v L} {\Lcaron }
x s {} {\v l} {\lcaron }
x s {} {\v N} {\Ncaron }
x s {} {\v n} {\ncaron }
x s {} {\v R} {\Rcaron }
x s {} {\v r} {\rcaron }
x s {} {\v S} {\Scaron }
x s {} {\v s} {\scaron }
x s {} {\v T} {\Tcaron }
x s {} {\v t} {\tcaron }
x s {} {\v Z} {\Zcaron }
x s {} {\v z} {\zcaron }
x e {en} {aacute} {a+1}
x e {en} {Aacute} {A+2}
x e {en} {agrave} {a+1}
x e {en} {Agrave} {A+2}
s l {abbreviation} {en}
s l {logo} {en}
s l {unit} {en}
r l {index} {en}
c \initializevariable\usedcolorchannels{}
c \listentry{chapter}{1}{1}{Blah}{2--0-1-0-0-0-0-0--1}{1}
c \listentry{section}{2}{1.1}{Xpto}{2--0-1-1-0-0-0-0--1}{1}
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: Ãçê}{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}
c \mainreference{}{incorr}{2--0-1-1-1-0-0-0--1}{1}{1.3}
c \initializevariable\currentstrategypass{1}
c \initializevariable\totalnofpositions{0}
c \initializevariable\totalnofMPgraphics{0}
c \initializevariable\totalnofparbackgrounds{0}
f e {test1}
c \initializevariable\lastpage{1}
c \initializevariable\lastpagenumber{1}

[-- Attachment #3: test11-ruby187-p174.pdf --]
[-- Type: application/pdf, Size: 55563 bytes --]

[-- Attachment #4: test1-ruby187-p174.tuo --]
[-- Type: application/octet-stream, Size: 1111 bytes --]

%
% loaded files: 1
%
% > test1 1
%
% temporary files: 0
%
%
% commands: 23
%
\thisissectionseparator{-}%
\thisisutilityversion{2008.10.14}%
\usedmapfile{=}{original-base}%
\usedmapfile{=}{original-ams-base}%
\usedmapfile{=}{original-public-lm}%
\usedmapfile{=}{lm-ec}%
\usedmapfile{=}{lm-math}%
\usedmapfile{=}{lm-rm}%
\usedmapfile{=}{original-ams-euler}%
\initializevariable\usedoutputdriver{pdftex}%
\initializevariable\usedcolorchannels{}%
\listentry{chapter}{1}{1}{Blah}{2--0-1-0-0-0-0-0--1}{1}%
\listentry{section}{2}{1.1}{Xpto}{2--0-1-1-0-0-0-0--1}{1}%
\mainreference{}{a}{2--0-1-1-0-0-0-0--1}{1}{1.1}%
\listentry{subsection}{3}{1.1.1}{Title with accents: Ãçê}{2--0-1-1-1-0-0-0--1}{1}%
\mainreference{}{b}{2--0-1-1-1-0-0-0--1}{1}{1.2}%
\mainreference{}{incorr}{2--0-1-1-1-0-0-0--1}{1}{1.3}%
\initializevariable\currentstrategypass{1}%
\initializevariable\totalnofpositions{0}%
\initializevariable\totalnofMPgraphics{0}%
\initializevariable\totalnofparbackgrounds{0}%
\initializevariable\lastpage{1}%
\initializevariable\lastpagenumber{1}%
%
% programs: 0
%
\endinput

[-- Attachment #5: test1.tex --]
[-- Type: application/x-tex, Size: 493 bytes --]

[-- Attachment #6: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10  3:15   ` Jose Augusto
@ 2009-08-10 13:10     ` Hans Hagen
  2009-08-10 15:21       ` Jose Augusto
  2009-08-10 15:15     ` Jose Augusto
  1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2009-08-10 13:10 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jose Augusto wrote:
> Hi all,
> 
> Ok, here it goes. Atached are the files used in the test.
> 
> The problem as reported in the >> previous email << used
> the file with the offending chars wrapped in a main file, which was just:
> 
> \starttext
> \input zzz.tex
> \stoptext
> 
> That is, the offending chars were in zzz.tex.
> 
> In that example I noticed the error because the cross-refs
> in the equation numbering were not working.
> The parsing of the .tui file by ruby 1.9.1 failed. Then I saw the errors.

ruby 1.9 internally is no longer 8 bit clean i.e. there is always an 
encoding (file as well as internal); there is no way to enforce this 
(there is the -E option but that is useless for 1.8)

i now open some files explicitly in binary mode; maybe that helps; i 
have no clue what happens with string manipulations later on

i always liked ruby but such fundamental changes (encoding, dropping 
functions etc) without renaming the program are a showstopper for me as 
one cannot predict what will be on the user's system

it looks like i have to convert the texutil part to lua (takes a few 
days and since i mostly use luatex it has a low priority)

i uploaded a beta for testing

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10  3:15   ` Jose Augusto
  2009-08-10 13:10     ` Hans Hagen
@ 2009-08-10 15:15     ` Jose Augusto
  1 sibling, 0 replies; 11+ messages in thread
From: Jose Augusto @ 2009-08-10 15:15 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 5080 bytes --]

Hi all,

I think I solved the problem. At least for my actual errors...
I read the following net article about string coding in ruby 1.9 and up:

      http://blog.grayproductions.net/articles/ruby_19s_string

With that info at hand, I made two >> brute-force "trial" patches << (read
the
above article to see why I call them "brute force" :-) ) in two of the ruby
context files
where problems were arising (original line numbers are shown):

###  .../scripts/context/ruby/base/tex.rb  ##
(946)  case str.chomp
    ===>>>
        str = str.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9"
        case str.chomp

### .../scripts/context/ruby/base/texutil.rb ###
(1033)  case line.chomp
   ===>>>
       line = line.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9"
       case line.chomp

The error is due to the fact that, by default, ruby 1.9 considers strings as
US-ASCII and complains when finding chars not in that encoding.

I don't know how to solve the problem for people writing in other
encoding which is not ISO-8859-1. I tried the above with UTF-8
instead of ISO-8859-1 and it didn't work.

Finally I don't know if there are any other places (at least case
expressions) in the
context ruby scripts where the problem might also show up.

Kind regards,

J. Augusto


On Mon, Aug 10, 2009 at 4:15 AM, Jose Augusto <jasaugusto@gmail.com> wrote:

> Hi all,
>
> Ok, here it goes. Atached are the files used in the test.
>
> The problem as reported in the >> previous email << used
> the file with the offending chars wrapped in a main file, which was just:
>
> \starttext
> \input zzz.tex
> \stoptext
>
> That is, the offending chars were in zzz.tex.
>
> In that example I noticed the error because the cross-refs
> in the equation numbering were not working.
> The parsing of the .tui file by ruby 1.9.1 failed. Then I saw the errors.
>
> But then I made >> a single context file <<, which goes attached
> with the correct results (tui, tuo, pdf), obtained with ruby 1.8.7.
>
> Howver, when i run ruby 1.9.1 with patch 129 (the last one), in this
> single tex file (attached) now the first pass don't work!
> Here is the result (in windows xp), which proves ruby 1.9.1 doesn't like
> the non US-ASCII chars :-)
>
> F:\ANOS\ano09-10-pen\NotasProcSinal>texexec test1.tex
> TeXExec | processing document 'test1.tex'
> TeXExec | no ctx file found
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:946:in `===':
> invalid byte sequence in US-ASCII (ArgumentError)
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:946: in
> `scantexcontent'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1907: in
> `processfile'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1143: in
> `block (2 levels) in processtex'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1133: in
> `timedrun'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1142: in
> `block in processtex'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1139: in
> `each'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/tex.rb:1139: in
> `processtex'
>         from
> D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:63:in`process'
>         from
> D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:53:in `main'
>         from
> D:/Context/tex/texmf-context/SCRIPTS/CONTEXT/ruby/base/switch.rb:133:in
> `execute'
>         from
> D:/Context/tex/texmf-context/scripts/context/ruby/texexec.rb:787:in `<main>'
>
> Thanks all for your interest,
>
> Kind regards
>
> J. Augusto
>
>
> On Sun, Aug 9, 2009 at 8:57 PM, Hans Hagen <pragma@wxs.nl> wrote:
>
>> Jose Augusto wrote:
>>
>>         when /^c (.*)$/o then @plugins.reader('MyCommands', [$1])
>>>
>>
>> what if you remove the o (/o)
>>
>> can you find out what changed between 1.8 and 1.9 ... actually 1.9 is the
>> stepping stone to 2.0 and 2 versions can be incompatible to 1 versions
>>
>> also, can you make a test file so that we can see if there's a platform
>> dependency?
>>
>>
>> -----------------------------------------------------------------
>>                                          Hans Hagen | PRAGMA ADE
>>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>>                                             | www.pragma-pod.nl
>> -----------------------------------------------------------------
>>
>> ___________________________________________________________________________________
>> 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
>>
>> ___________________________________________________________________________________
>>
>
>

[-- Attachment #1.2: Type: text/html, Size: 6817 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 13:10     ` Hans Hagen
@ 2009-08-10 15:21       ` Jose Augusto
  2009-08-10 16:27         ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Augusto @ 2009-08-10 15:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2579 bytes --]

I Hans,

I just sent a mail with a possible patch, before I read this answer from you
:-)
As I say there, the patches work (at least for me) and I had updated context
mkii a few hours ago, so I don't know if the betas you mentioned have
already
been installed...

Hope the proposed patches be helpful...
Thx very much for your answer.

J. Augusto

On Mon, Aug 10, 2009 at 2:10 PM, Hans Hagen <pragma@wxs.nl> wrote:

> Jose Augusto wrote:
>
>> Hi all,
>>
>> Ok, here it goes. Atached are the files used in the test.
>>
>> The problem as reported in the >> previous email << used
>> the file with the offending chars wrapped in a main file, which was just:
>>
>> \starttext
>> \input zzz.tex
>> \stoptext
>>
>> That is, the offending chars were in zzz.tex.
>>
>> In that example I noticed the error because the cross-refs
>> in the equation numbering were not working.
>> The parsing of the .tui file by ruby 1.9.1 failed. Then I saw the errors.
>>
>
> ruby 1.9 internally is no longer 8 bit clean i.e. there is always an
> encoding (file as well as internal); there is no way to enforce this (there
> is the -E option but that is useless for 1.8)
>
> i now open some files explicitly in binary mode; maybe that helps; i have
> no clue what happens with string manipulations later on
>
> i always liked ruby but such fundamental changes (encoding, dropping
> functions etc) without renaming the program are a showstopper for me as one
> cannot predict what will be on the user's system
>
> it looks like i have to convert the texutil part to lua (takes a few days
> and since i mostly use luatex it has a low priority)
>
> i uploaded a beta for testing
>
> Hans
>
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3714 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 15:21       ` Jose Augusto
@ 2009-08-10 16:27         ` Hans Hagen
  2009-08-10 17:20           ` Jose Augusto
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2009-08-10 16:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jose Augusto wrote:
> I Hans,
> 
> I just sent a mail with a possible patch, before I read this answer from you
> :-)
> As I say there, the patches work (at least for me) and I had updated context
> mkii a few hours ago, so I don't know if the betas you mentioned have
> already
> been installed...
> 
> Hope the proposed patches be helpful...

your patch will not work with ruby < 1.9 so if my patch (opening files 
in rb mode) works ok that's more robust;

another option is to patch texmfstart.rb

#!/usr/bin/env ruby
#encoding: ASCII-8BIT


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 16:27         ` Hans Hagen
@ 2009-08-10 17:20           ` Jose Augusto
  2009-08-10 17:39             ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Augusto @ 2009-08-10 17:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2784 bytes --]

Hi Hans,

The patch I proposed works also with ruby less than 1.9 (e.g. ruby 1.8.7)!
The force_encoding() method is used only if RUBY_VERSION >= 1.9.
If the scripts are executed by ruby 1.8 or lesser version, there's no change
done to
the current line of code (e.g. 'case line.chomp' ).

Also, I verified the patch with ruby 1.8.7 and  with 1.9.1, and it worked in
both cases.

The patch has however the problem of slowing processing (the "if" is
executed
when parsing each line of the files, and probably this issue could be
optimized...)

Meanwhile I don't think that the magic string
# encoding: ASCII-8BIT
solves the problem. This string indicates that the script is written in
ASCII-8BIT,
but when is reading the strings from the .tex or .tui files ruby 1.9.1
considers
them as US-ASCII regardless of the encoding declared in # encoding: ...

I introduced " # encoding: ASCII-8BIT  " in texmfstart.rb, tex.rb and
texutil.rb
and the problem didn't disapeer :-(

Of course I may be wrong. But the experiments I did make me think this way.
Also, I don't have Linux at my disposal (I mean, with context installed) and
there
the behavior perhaps is different...

Kind regards and thank you very much.

J. Augusto






On Mon, Aug 10, 2009 at 5:27 PM, Hans Hagen <pragma@wxs.nl> wrote:

> Jose Augusto wrote:
>
>> I Hans,
>>
>> I just sent a mail with a possible patch, before I read this answer from
>> you
>> :-)
>> As I say there, the patches work (at least for me) and I had updated
>> context
>> mkii a few hours ago, so I don't know if the betas you mentioned have
>> already
>> been installed...
>>
>> Hope the proposed patches be helpful...
>>
>
> your patch will not work with ruby < 1.9 so if my patch (opening files in
> rb mode) works ok that's more robust;
>
> another option is to patch texmfstart.rb
>
> #!/usr/bin/env ruby
> #encoding: ASCII-8BIT
>
>
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 3982 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 17:20           ` Jose Augusto
@ 2009-08-10 17:39             ` Hans Hagen
  2009-08-10 18:11               ` Jose Augusto
  0 siblings, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2009-08-10 17:39 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jose Augusto wrote:

> Meanwhile I don't think that the magic string
> # encoding: ASCII-8BIT
> solves the problem. This string indicates that the script is written in
> ASCII-8BIT,
> but when is reading the strings from the .tex or .tui files ruby 1.9.1
> considers
> them as US-ASCII regardless of the encoding declared in # encoding: ...

not when opened as 'rb' (which i do in the latest texexec.rb) so i 
wonder why that does not work at your place

(http://blog.nuclearsquid.com/writings/ruby-1-9-encodings)

i run ruby 1.8.6 (and on a couple of servers even older versions and i'm 
not going to touch ruby on these machines (i don't want to patch scripts 
that are supposed to run another 5-10 years) but i might update context 
and texexec)

> I introduced " # encoding: ASCII-8BIT  " in texmfstart.rb, tex.rb and
> texutil.rb
> and the problem didn't disapeer :-(

hm, it worked here

> Of course I may be wrong. But the experiments I did make me think this way.
> Also, I don't have Linux at my disposal (I mean, with context installed) and
> there
> the behavior perhaps is different...

that's my biggest fear ... introducing more problems


Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 17:39             ` Hans Hagen
@ 2009-08-10 18:11               ` Jose Augusto
  2009-08-10 18:20                 ` Hans Hagen
  0 siblings, 1 reply; 11+ messages in thread
From: Jose Augusto @ 2009-08-10 18:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2898 bytes --]

Hi Hans,

I ran just now ruby 1.8.6 and the force_encoding() patch worked well.

Just now I upgrade "--context=current". The banner in the texexec.rb is
banner = ['TeXExec', 'version 6.2.1', '1997-2009', 'PRAGMA ADE/POD']
and the date of this script (after updating) is 10-04-2009 (its April..)

I'm running mkii. How do I get mkii beta scripts, as texexec.rb you mention?

All my rubys are compiled from the box with mingw in windows
(2000 or XP, in 3 different machines). Of course the encoding
thing is different in Linux, Windows (and DOS prompts, for the matter),
so there is probably different behavior in ruby/context/tex interaction with

chars in Linux and Windows boxes...

Thx

Jose

On Mon, Aug 10, 2009 at 6:39 PM, Hans Hagen <pragma@wxs.nl> wrote:

> Jose Augusto wrote:
>
>  Meanwhile I don't think that the magic string
>> # encoding: ASCII-8BIT
>> solves the problem. This string indicates that the script is written in
>> ASCII-8BIT,
>> but when is reading the strings from the .tex or .tui files ruby 1.9.1
>> considers
>> them as US-ASCII regardless of the encoding declared in # encoding: ...
>>
>
> not when opened as 'rb' (which i do in the latest texexec.rb) so i wonder
> why that does not work at your place
>
> (http://blog.nuclearsquid.com/writings/ruby-1-9-encodings)
>
> i run ruby 1.8.6 (and on a couple of servers even older versions and i'm
> not going to touch ruby on these machines (i don't want to patch scripts
> that are supposed to run another 5-10 years) but i might update context and
> texexec)
>
>  I introduced " # encoding: ASCII-8BIT  " in texmfstart.rb, tex.rb and
>> texutil.rb
>> and the problem didn't disapeer :-(
>>
>
> hm, it worked here
>
>  Of course I may be wrong. But the experiments I did make me think this
>> way.
>> Also, I don't have Linux at my disposal (I mean, with context installed)
>> and
>> there
>> the behavior perhaps is different...
>>
>
> that's my biggest fear ... introducing more problems
>
>
> Hans
>
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------
>
> ___________________________________________________________________________________
> 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
>
> ___________________________________________________________________________________
>

[-- Attachment #1.2: Type: text/html, Size: 4555 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Ruby 1.9.1 and non-ascii char parsing in .tui file
  2009-08-10 18:11               ` Jose Augusto
@ 2009-08-10 18:20                 ` Hans Hagen
  0 siblings, 0 replies; 11+ messages in thread
From: Hans Hagen @ 2009-08-10 18:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Jose Augusto wrote:
> Hi Hans,
> 
> I ran just now ruby 1.8.6 and the force_encoding() patch worked well.

yes, but if we can avoid adapting all those strings ... i'm pretty sure 
that if we follow that route we have to patch a lot

also keep in mind that in 1.9 there are several encodings (external and 
internal) so setting up a roundtrip using the string properties involves 
more patches)

> Just now I upgrade "--context=current". The banner in the texexec.rb is
> banner = ['TeXExec', 'version 6.2.1', '1997-2009', 'PRAGMA ADE/POD']
> and the date of this script (after updating) is 10-04-2009 (its April..)
> 
> I'm running mkii. How do I get mkii beta scripts, as texexec.rb you mention?

it depends: if (on linux) "texexec" is a big file then you need to copy 
texexec.rb to texexec, else if it's a stub it should just work (in that 
case texmfstart will start texexec.rb)

> All my rubys are compiled from the box with mingw in windows
> (2000 or XP, in 3 different machines). Of course the encoding
> thing is different in Linux, Windows (and DOS prompts, for the matter),
> so there is probably different behavior in ruby/context/tex interaction with

on windows there should be a stub (something texexec.cmd == "ruby 
texmfstart texexec ...")

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-08-10 18:20 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-08 19:16 Ruby 1.9.1 and non-ascii char parsing in .tui file Jose Augusto
2009-08-09 19:57 ` Hans Hagen
2009-08-10  3:15   ` Jose Augusto
2009-08-10 13:10     ` Hans Hagen
2009-08-10 15:21       ` Jose Augusto
2009-08-10 16:27         ` Hans Hagen
2009-08-10 17:20           ` Jose Augusto
2009-08-10 17:39             ` Hans Hagen
2009-08-10 18:11               ` Jose Augusto
2009-08-10 18:20                 ` Hans Hagen
2009-08-10 15:15     ` Jose Augusto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).