unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Multiple encodings in one file
Date: Mon, 29 Apr 2024 10:22:15 +0300	[thread overview]
Message-ID: <86plu8skew.fsf@gnu.org> (raw)
In-Reply-To: <SA1PR01MB66053ED8575D28A5F4C6FF8BD91B2@SA1PR01MB6605.prod.exchangelabs.com> (JLambert@MissouriState.edu)

> 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	other threads:[~2024-04-29  7:22 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 [this message]
2024-04-29 18:45   ` Lambert, Joshua D
2024-04-29 19:14     ` Eli Zaretskii
2024-04-29 21:07       ` Lambert, Joshua D
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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86plu8skew.fsf@gnu.org \
    --to=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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).