From owner-freebsd-questions Fri Jan 1 04:34:13 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA06570 for freebsd-questions-outgoing; Fri, 1 Jan 1999 04:34:13 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mh2.cts.com (mh2.cts.com [209.68.192.68]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA06565 for ; Fri, 1 Jan 1999 04:34:12 -0800 (PST) (envelope-from preeper@cts.com) Received: from sgt361.cts.com (gt361.cts.com [204.212.158.91]) by mh2.cts.com (8.8.7/8.8.5) with SMTP id EAA06114 for ; Fri, 1 Jan 1999 04:33:49 -0800 (PST) Message-Id: <3.0.5.32.19990101042759.008a1a70@crash.cts.com> X-Sender: preeper@crash.cts.com X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Fri, 01 Jan 1999 04:27:59 -0800 To: freebsd-questions@FreeBSD.ORG From: Jerry Preeper Subject: replace non-ascii characters Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I know this isn't really a freebsd question, but I'm not sure where else to ask. I'm trying to write a small shell script that replaces non-ascii characters with the html equivalent in a file and just can't seem to figure how to identify the non-ascii characters. for example, I have written a small shell script that takes a file name as input to replace them using sed. Here is the script. #!/bin/sh for file in $* do sed -n "s/\\0x80/\Ç\;/g" ${file} sed -n "s/\\0x81/\ü\;/g" ${file} ..... bunches more done The problem is the search part isn't finding the special character. I have tried cutting and pasting the special character directly into the script as well, but it doesn't seem to work either. Does anyone have any ideas on how to accomplish. Thanks in advance. Jerry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message