From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Haines Brown Newsgroups: gmane.emacs.help Subject: Re: fixing M$ character codes Date: Mon, 05 Jul 2004 10:00:21 GMT Organization: SBC http://yahoo.sbc.com Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <874qomvkpy.fsf@teufel.hartford-hwp.com> References: <2ko3egF4flbgU1@uni-berlin.de> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1089021823 18632 80.91.224.253 (5 Jul 2004 10:03:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 5 Jul 2004 10:03:43 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jul 05 12:03:33 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BhQJx-0002NM-00 for ; Mon, 05 Jul 2004 12:03:33 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BhQLu-0002Zp-Qn for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Jul 2004 06:05:34 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!prodigy.com!prodigy.com!newsmst01a.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr19.news.prodigy.com.POSTED!0fe8b877!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs,alt.religion.emacs Original-Lines: 41 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Original-NNTP-Posting-Host: 64.252.21.120 Original-X-Complaints-To: abuse@prodigy.net Original-X-Trace: newssvr19.news.prodigy.com 1089021621 ST000 64.252.21.120 (Mon, 05 Jul 2004 06:00:21 EDT) Original-NNTP-Posting-Date: Mon, 05 Jul 2004 06:00:21 EDT X-UserInfo1: Q[R_@SFDWRRMR]PX_@CBNQ@@AZOZ@GXOXZ\@LWQHBATBTSUBYFWEAE[YJLYPIWKHTFCMZKVMB^[Z^DOBRVVMOSPFHNSYXVDIE@X\BUC@GTSX@DL^GKFFHQCCE\G[JJBMYDYIJCZM@AY]GNGPJD]YNNW\GSX^GSCKHA[]@CCB\[@LATPD\L@J\\PF]VR[QPJN Original-Xref: shelby.stanford.edu gnu.emacs.help:124134 comp.emacs:85312 alt.religion.emacs:8554 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:19465 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:19465 Jym Dyer writes: > =v= I think ideally the code would parse headers to figure out > whether the brain damaged quotes are supposed to be ISO-Latin, > Windows-1252, UTF-8, or whatever. But for now I just use a > sledgehammer and convert any and all needlessly-8bit characters > to their 7bit equivalents. > > =v= The code I use is below. I suppose someday I ought to make > them more comprehensive, but for now I just add what I need > along the way. (Warning: this converts all know quotes and > dashes to ASCII equivalents, but also convert centered dots to > asterisks, which isn't exactly an equivalent.) > <_Jym_> > > > (defun jym.de8 () > "Turn 8bit characters into 7bit equivalents." > (interactive) > (mapcar > (function (lambda (old_and_new) > (save-excursion (apply 'query-replace old_and_new)))) > '(("­" "-") > ("¹" "'") > ... Jym, As on who often has to process documents with 8-bit characters, your lisp code was certainly welcome. But it does not seem to do anything. I'm running emacs 21.2.1 and pasted the code you supplied into ~/.emacs, and reloaded emacs. If I open a test file that is filled with these 8-bit characters, it is displayed in emacs without any change. What am I doing wrong? -- Haines Brown