help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multiple encodings in one file


From: Lambert, Joshua D
Subject: Re: Multiple encodings in one file
Date: Mon, 29 Apr 2024 21:07:42 +0000

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 via email to

[Prev in Thread] Current Thread [Next in Thread]