From: dkcombs@panix.com (David Combs)
To: help-gnu-emacs@gnu.org
Subject: Re: how to scan file for non-ascii chars (eg cut-n-paste from ms-word)
Date: Tue, 18 Jan 2011 19:54:12 +0000 (UTC) [thread overview]
Message-ID: <ih4r54$fnv$1@reader1.panix.com> (raw)
In-Reply-To: mailman.11.1294583034.18702.help-gnu-emacs@gnu.org
In article <mailman.11.1294583034.18702.help-gnu-emacs@gnu.org>,
Eli Zaretskii <eliz@gnu.org> wrote:
>> From: dkcombs@panix.com (David Combs)
>> Newsgroups: gnu.emacs.help
>> Date: 8 Jan 2011 19:53:01 -0500
>>
>> When I 'cut-n-paste' from eg ms-word-produced document, into an
>> emacs buffer (ie ascii), you get all kinds of "non-ascii" chars,
>> eg left and right double-quotes, like these:
>>
>>
>> Char: . (8221, #o20035, #x201d) point=250 of 4096 (6%) column=7
>> Char: . (8220, #o20034, #x201c) point=218 of 4096 (5%) column=42
>>
>>
>> accents, and so on.
>>
>> When I go to save the buffer, emacs will ask if I want to
>> save it in eg japanese format. Not exactly what I want.
>
>Doesn't it suggest utf-8 as one of the possible encodings? If so, why
>not use utf-8 and leave these characters in the file?
Because (er, as an excuse) I often want to copy-paste them into
an ASCII hints-and-tricks file I keep for my own use, and
which I then edit and search-within via emacs (of course).
Suppose I want to PRINT from that supposedly-ASCII file --
does my old (but wonderful) HP-1200 laserjet -- all it has
for fonts are the original times, some-sans-serif one,
something else (I forget), and "symbol". Isn't that
a problem?
FURTHER, and more importantly, how do I *search* for
one of these funny things, a left-double-quote, say?
It's so *easy* to just hit C-s "!
Given my current state of emacs-knowledge on "foreign"
fonts (like zero), that's what I say -- until I can
somehow learn more.
Thanks!
>
>> What I'd like to do is change those "strange" characters
>> to their plain-ascii "equivalent", so to speak. Like
>> '"' for double quote (left OR right), etc.
>
>Not sure why would you want that, but doesn't M-% solve this problem
>nicely? If not, why not?
>
You mean do a query-replace on each non-ascii char? How do I
even know which ones are even *in* some buffer of text?
What'd be nice is something that went through the whole
buffer *once*, doing the "right thing" with each
non-ascii char.
Do I make any sense? Or do I not really understand?
Thanks,
David
next prev parent reply other threads:[~2011-01-18 19:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-09 0:53 how to scan file for non-ascii chars (eg cut-n-paste from ms-word) David Combs
2011-01-09 14:23 ` Eli Zaretskii
2011-01-09 16:24 ` Kenneth Goldman
2011-01-09 17:30 ` Eli Zaretskii
2011-01-09 17:53 ` how to scan file for non-ascii chars (egcut-n-paste " Drew Adams
[not found] ` <mailman.8.1294595713.11727.help-gnu-emacs@gnu.org>
2011-01-18 20:19 ` David Combs
2011-01-19 2:02 ` how to scan file for non-ascii chars(egcut-n-paste " Drew Adams
[not found] ` <mailman.5.1294594249.11727.help-gnu-emacs@gnu.org>
2011-01-18 20:06 ` how to scan file for non-ascii chars (eg cut-n-paste " David Combs
[not found] ` <mailman.11.1294583034.18702.help-gnu-emacs@gnu.org>
2011-01-18 19:54 ` David Combs [this message]
2011-01-18 21:32 ` harven
2011-01-19 4:38 ` Teemu Likonen
2011-01-20 6:57 ` Kevin Rodgers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='ih4r54$fnv$1@reader1.panix.com' \
--to=dkcombs@panix.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.