Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Hans Hagen
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Jose Augusto
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Jose Augusto
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Hans Hagen
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Jose Augusto
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Hans Hagen
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Jose Augusto
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

Re: [NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-10 Thread Hans Hagen
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

[NTG-context] Ruby 1.9.1 and non-ascii char parsing in .tui file

2009-08-08 Thread Jose Augusto
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