all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Lambert, Joshua D" <JLambert@MissouriState.edu>
To: Eli Zaretskii <eliz@gnu.org>,
	"help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Multiple encodings in one file
Date: Mon, 29 Apr 2024 21:07:42 +0000	[thread overview]
Message-ID: <SA1PR01MB6605A76A6BF3DAA83039DF45D91B2@SA1PR01MB6605.prod.exchangelabs.com> (raw)
In-Reply-To: <86jzkgq8v0.fsf@gnu.org>

Thank you very much. This is helpful.

Joshua
________________________________
From: help-gnu-emacs-bounces+jlambert=missouristate.edu@gnu.org <help-gnu-emacs-bounces+jlambert=missouristate.edu@gnu.org> on behalf of Eli Zaretskii <eliz@gnu.org>
Sent: Monday, April 29, 2024 2:14 PM
To: help-gnu-emacs@gnu.org <help-gnu-emacs@gnu.org>
Subject: Re: Multiple encodings in one file

CAUTION: External Sender


> From: "Lambert, Joshua D" <JLambert@MissouriState.edu>
> Date: Mon, 29 Apr 2024 18:45:52 +0000
> msip_labels:
>
> Thank you for the time. What you said gives me some hope but I have a follow-up question. If I visit a file
> literally, make a change, and save it, the file seems to be different only where I changed it. Is that true?

If you save it while binding coding-system-to-write to no-conversion,
yes.  IOW, you need to disable encoding while saving.

> If so, then does the following seem reasonable.
>
> 1 Find a file literally.
> 2 The user will accept that some characters will show octal codes or something similar.
> 3 Edit the records where understandable and possible.
> 4 Save file.

That can be done, of course, but note that UTF-8 encoded text is not
legible, unless the characters are all ASCII.

> Furthermore, if I want to try to convert the MARC8 encoded records to UTF8 (mappings are available), is it
> reasonable/possible for me to do that in the buffer after using find-file-literally or would it be better to do that
> using hexl-mode, or another method?

You can convert MARC-8 to Unicode (not UTF-8, since Emacs uses
internal representation that is not exactly UTF-8), yes.  But then you
will have to convert back to MARC-8 when you save the file, at least
in the parts that the user didn't edit.

This message originated outside Missouri State University. Please use caution when opening attachments, clicking links, or replying.



  reply	other threads:[~2024-04-29 21:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-29  4:20 Multiple encodings in one file Lambert, Joshua D
2024-04-29  7:22 ` Eli Zaretskii
2024-04-29 18:45   ` Lambert, Joshua D
2024-04-29 19:14     ` Eli Zaretskii
2024-04-29 21:07       ` Lambert, Joshua D [this message]
2024-04-30  2:02       ` Stefan Monnier via Users list for the GNU Emacs text editor
2024-04-30 17:17         ` Lambert, Joshua D

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=SA1PR01MB6605A76A6BF3DAA83039DF45D91B2@SA1PR01MB6605.prod.exchangelabs.com \
    --to=jlambert@missouristate.edu \
    --cc=eliz@gnu.org \
    --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.