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: Eli Zaretskii
Subject: Re: Multiple encodings in one file
Date: Mon, 29 Apr 2024 10:22:15 +0300

> From: "Lambert, Joshua D" <JLambert@MissouriState.edu>
> Date: Mon, 29 Apr 2024 04:20:54 +0000
> msip_labels: 
> 
> Question: If I open a file that uses one encoding in one part of the file and 
> another encoding in another part of the file, and also uses multiple 
> character sets, can I edit a small part of it in Emacs, using UCS (Unicode), 
> without Emacs changing the rest of the file?

No.  The built-in machinery for encoding and decoding file's contents
when visiting or saving files assumes the same encoding for the entire
file.  To support files whose different parts are encoded differently,
you will need to decode each part "by hand": visit the file literally,
then loop over each part and decode each part using
decode-coding-region.  When saving, do the opposite.



reply via email to

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