[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
awk bug substr
From: |
Gilali |
Subject: |
awk bug substr |
Date: |
Thu, 20 Jan 2011 21:38:57 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
Hello,
First, thank you very much for all your good work, awk is a tool very
very usefull.
now, i think a found a real bug :
All awk internal functions are working OK also in utf-8 or in iso-8859-1
text format. All, except one : susbtr function, see this :
GNU Awk 3.1.8
vi test.awk :
BEGIN{
line="ééé blabla from me" ## ééé character is here for be sure the file
will be saved in utf-8 format
if (match(line,"from")){
print "matching is OK"
test=substr(line,RSTART,RLENGTH)
print test}}
awk -f test.awk :
matching is OK
from
############ it's normal, but :
iconv -f utf-8 -t iso-8859-1 test.awk -o test.awk
awk -f test.awk:
matching is OK # but nothing else instead of showing "from"
AND REVERSE
iconv -f iso-8859-1 -t utf-8 test.awk -o test.awk
awk -f test.awk:
matching is OK
from
I think is a bug because all others function working well in iso-8859-1:
sub, match (tested here), split etc... only substr not working.
Please tell me if is a real bug
Regards
- awk bug substr,
Gilali <=