[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple encodings in one file
From: |
Eli Zaretskii |
Subject: |
Re: Multiple encodings in one file |
Date: |
Mon, 29 Apr 2024 22:14:43 +0300 |
> 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.