From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Multiple encodings in one file Date: Mon, 29 Apr 2024 22:14:43 +0300 Message-ID: <86jzkgq8v0.fsf@gnu.org> References: <86plu8skew.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28728"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 29 21:15:42 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s1WTW-0007EE-Bp for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 29 Apr 2024 21:15:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1WSl-0006qp-Ox; Mon, 29 Apr 2024 15:14:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1WSk-0006p8-IQ for help-gnu-emacs@gnu.org; Mon, 29 Apr 2024 15:14:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1WSi-0004wD-FO for help-gnu-emacs@gnu.org; Mon, 29 Apr 2024 15:14:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NPVv7kGitSHrQ51xbZTJKFNBwGY8txTWs2BZjh8cun4=; b=sgykhBScmFjD OGQiwy8YxpbwFdC1n+QC/KJDL0tJwmT/kMfLtv8Et5cvMvKz+hSFvqVALuDNsu9URC1XzWIt4QdmL ivzE16aXxsgSPrJCuikeFVPCKf0s77kB4QlEWVR3ISkxEGpODw92hqinAXk2HHi6HZhrwvYPheNR5 bVF9tMivIv07eKMk7OnmgtguKL6aTDjzd81EoCN6UzznUHYQfVd/B+/hTNwFUSln+2CQtFiAZHkEt mxA4fMNY+00OGiJ2p7wTlEgfVK4gPhcAwz9LDzHO2JjE+kSKWeUanSLHvUs+REHdIN9VABqJvTV1y 3fpqriUjPLxfhUOqdshixw==; In-Reply-To: (JLambert@MissouriState.edu) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:146503 Archived-At: > From: "Lambert, Joshua D" > 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.