Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sun-barr!ccut!kogwy!wnoc-tyo-news!sragwa!hxrdgw!ishii From: ishii@hexard.co.jp (Koji Ishii) Newsgroups: comp.lang.perl Subject: tr/// cannot translate to chars whose codes are greater than 127 Message-ID: Date: 31 Oct 90 08:46:32 GMT Sender: ishii@hexard.co.jp Distribution: comp Organization: Hexard Inc., Tokyo, Japan. Lines: 51 Tested on perl3.0.37 on Sun4 (OS4.0.3c), tr/\000-\177/\200-\377/; does nothing. In scantrans() in toke.c, characters are assigned to signed char, and then to signed short, extending sign. Generated table is checked in do_trans() in doarg.c whether it is less than 0, so all translations are ignored. Following patch will fix problem. *** toke.c.orig Wed Oct 31 17:03:40 1990 --- toke.c Wed Oct 31 17:07:53 1990 *************** *** 1906,1912 **** } --j; } ! tbl[i] = r[j]; } } } --- 1906,1912 ---- } --j; } ! tbl[i] = r[j] & 0377; } } } *************** *** 1923,1929 **** --j; } if (tbl[t[i] & 0377] == -1) ! tbl[t[i] & 0377] = r[j]; } } if (r != t) --- 1923,1929 ---- --j; } if (tbl[t[i] & 0377] == -1) ! tbl[t[i] & 0377] = r[j] & 0377; } } if (r != t) -- ---------------------------------- Koji Ishii Hexard Inc., Tokyo, Japan. JUNET: ishii@hexard.co.jp