bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: i18n: special letter(s?) cause regular expression error in match() a


From: Seb
Subject: Re: i18n: special letter(s?) cause regular expression error in match() and wrong length()
Date: Sun, 4 Jan 2009 12:29:55 +0100

Le Sat, 03 Jan 2009 18:44:27 +0100
"R. Bijlsma" <address@hidden> a écrit:

Hello,

Are you sure of the encoding of your _program file_. I've tried with the file 
you
sent and, effectively, I've got your weird results. But my system uses Latin1, 
so
my mail client converted your file during its recording on my disk.

If I convert it to UTF8:

$ iconv -t UTF8 /tmp/bug_special_letters.awk > /tmp/bug_special_letters-utf8.awk

Then remake your test:

****
$ LANG=en_US.UTF8 awk -f /tmp/bug_special_letters-utf8.awk \
  /tmp/bug_special_letters-utf8.awk

________________________________________________________________________
'e'
Length: 1
!~ /(de[^\"]+)\.(.+)/   with both ~ and match(), RSTART=0, RLENGTH=-1
!~ /(.+de)(.+)/         with both ~ and match(), RSTART=0, RLENGTH=-1
~  /.+/                 with both ~ and match(), RSTART=1, RLENGTH=1
________________________________________________________________________
'é'
Length: 1
!~ /(de[^\"]+)\.(.+)/   with both ~ and match(), RSTART=0, RLENGTH=-1
!~ /(.+de)(.+)/         with both ~ and match(), RSTART=0, RLENGTH=-1
~  /.+/                 with both ~ and match(), RSTART=1, RLENGTH=1
________________________________________________________________________
'Na deze regel één lege regel. After this line one empty line.'
Length: 61
~  /(de[^\"]+)\.(.+)/   with both ~ and match(), RSTART=4, RLENGTH=58
                        1 (de[^\"]+): 'deze regel één lege regel', length =
Length: 25 2 (.+): ' After this line one empty line.', length = Length: 32
~  /(.+de)(.+)/         with both ~ and match(), RSTART=1, RLENGTH=61
                        1 (.+de): 'Na de', length = Length: 5
                        2 (.+): 'ze regel één lege regel. After this
line one empty line.', length = Length: 56 ~  /.+/                 with both
~ and match(), RSTART=1, RLENGTH=61
________________________________________________________________________ ''
Length: 0
!~ /(de[^\"]+)\.(.+)/   with both ~ and match(), RSTART=0, RLENGTH=-1
!~ /(.+de)(.+)/         with both ~ and match(), RSTART=0, RLENGTH=-1
!~ /.+/                 with both ~ and match(), RSTART=0, RLENGTH=-1
________________________________________________________________________
'Voor deze regel een lege regel. Before this line an empty line.'
Length: 63
~  /(de[^\"]+)\.(.+)/   with both ~ and match(), RSTART=6, RLENGTH=58
                        1 (de[^\"]+): 'deze regel een lege regel', length =
Length: 25 2 (.+): ' Before this line an empty line.', length = Length: 32
~  /(.+de)(.+)/         with both ~ and match(), RSTART=1, RLENGTH=63
                        1 (.+de): 'Voor de', length = Length: 7
                        2 (.+): 'ze regel een lege regel. Before this line an
empty line.', length = Length: 56 ~  /.+/                 with both ~ and match
(), RSTART=1, RLENGTH=63

*****
The resulting values seem to be right. :)

++
Seb.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]