From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Lambert, Joshua D" Newsgroups: gmane.emacs.help Subject: Re: Multiple encodings in one file Date: Mon, 29 Apr 2024 18:45:52 +0000 Message-ID: References: <86plu8skew.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39960"; mail-complaints-to="usenet@ciao.gmane.io" To: Eli Zaretskii , "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 20:46:49 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 1s1W1Y-000ADC-03 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 29 Apr 2024 20:46:48 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s1W0w-0005Uu-Lm; Mon, 29 Apr 2024 14:46:10 -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 1s1W0v-0005Uh-77 for help-gnu-emacs@gnu.org; Mon, 29 Apr 2024 14:46:09 -0400 Original-Received: from mail-mw2nam10on2126.outbound.protection.outlook.com ([40.107.94.126] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s1W0n-00005p-Tk; Mon, 29 Apr 2024 14:46:08 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S0CDi5FcE9w5DxuEMvCl39FuVbkl6sgjNhQtXWYrW+r8D8xR96jQPqrggi1xkSG6V+Wg6N8ApAZLiOqbKuiBbGFk41jW7OXCa2m0y3VpBDMucqbeRD+WTQ+SnV9xSuTICGc8EkhYiAIJlu4rL6edum/H3CuUMmn7zAomEJCohuRRerU2Vp0zObIep1cCYeJOvMMmNBzBiwiyY/5V9UR5p/DRBgZDESUB8eSgARJnrwdEs1kiuZX7wMCQNbxRZOg3kEm0RqH5dFWNh4faXXBsAu/yp5G0NDFx7TMJ5E7wvSSDdEAmnyfSD4kohKLH4x0wgzdAQplq2XukT6AF6SpAHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=M+V4/lnG/6t+Smg2rOFSDLBvWLgICZ8cI1Cj3T7Fau4=; b=JX11HJrcQ+o/hBznXTsD8B/p9lWy1oCkJiYC2j4D00zm4m0joXQk1BodP7CPcVFYbwySCgVuGce3v+z/8viOI2RqpZIRSjnsP3U/+iEtO7i3lIARoo2IMUUW+VHvxoVf3k541QYRCCmS5E2el7mls06pVgsSy88+5yyep65meWOgIJhe3EyZyJIydmgIBjcVLkxbkHNgdBoMWcoPS4s3wo/qhu20uYt7sK+vmxKdfX9ibhHhAclIWa/GlI2z583Cik4BdQIlRZI2g361iMNgUQW5pvZoqlnL1QQ4vT0ea7Y7F72+8rCX9DMgeihn0vNloqASQpa/Wdomfchr55Q1GA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=missouristate.edu; dmarc=pass action=none header.from=missouristate.edu; dkim=pass header.d=missouristate.edu; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=missouristate.edu; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=M+V4/lnG/6t+Smg2rOFSDLBvWLgICZ8cI1Cj3T7Fau4=; b=n1W903a0zWT0yfvhp2KdG8n51LnWxw/Mf+yOIFNb69L/VAeUC+fs80vyIysazqLoslSNnyKP1Qur43lwfDosxMCypHjpgbXEmw+DT+UkKxiMIkqKCP5BSjlAEPUIpPceWD+yKCW2WC6rOETxl1vgUrUGbMcfOHFW58D/Lj4aiQQ= Original-Received: from SA1PR01MB6605.prod.exchangelabs.com (2603:10b6:806:1a3::14) by DM4PR01MB7618.prod.exchangelabs.com (2603:10b6:8:61::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7519.35; Mon, 29 Apr 2024 18:45:52 +0000 Original-Received: from SA1PR01MB6605.prod.exchangelabs.com ([fe80::99bc:ffa2:a45e:a4b7]) by SA1PR01MB6605.prod.exchangelabs.com ([fe80::99bc:ffa2:a45e:a4b7%7]) with mapi id 15.20.7519.031; Mon, 29 Apr 2024 18:45:52 +0000 Thread-Topic: Multiple encodings in one file Thread-Index: AQHameY4mKSP1S4V+0CQey1THwfYt7F+2GEggAC3l4E= In-Reply-To: <86plu8skew.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=MissouriState.edu; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SA1PR01MB6605:EE_|DM4PR01MB7618:EE_ x-ms-office365-filtering-correlation-id: b51464c4-f7b0-4e58-2548-08dc687c9893 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230031|376005|366007|1800799015|38070700009; x-microsoft-antispam-message-info: =?iso-8859-1?Q?+yHPIG9YVe9japOrqLH11zUOW6eQGu3i8IEapwTQQbBtAoiTnDb4IKxNbP?= =?iso-8859-1?Q?vDevQsBRHWZDgi347eZG4I6jgabbw+dvdSot/geVnWkEB7EIdwfHtNltEL?= =?iso-8859-1?Q?weQwSi3qZqSSES9K6+Y1bmYNe3g99p4qivIxzqhqxcENZ7YcSEIKfoDxsO?= =?iso-8859-1?Q?2HsXLzLcZTAhHKKZtx4N8oeJmqcVOphmBcXvGRUQK+T209wJFRo1AOOfDZ?= =?iso-8859-1?Q?udLeRY7BZFOPCxqYFib47ueySH4/1NiMfZYQnAgJBXd7QmecTylHnZgYOX?= =?iso-8859-1?Q?yzOUQRz3L7OBG+Fy1bvm+U3ixLSxKHZyBdJZCGeavnoRauTJjkwrjfhFMw?= =?iso-8859-1?Q?J8Z75Fc23k6dWCqpLPeL5YbXvyzKZeJCjOKAneu5h4BU55f+9+/25f2t5J?= =?iso-8859-1?Q?p7DzZBXmDWpwa8B899f1R00ioeY8yFjQ9yQZACCxTygWI+KJEfS05BB9OI?= =?iso-8859-1?Q?USWvLfURX7A5dAftJVZpCkbF/akMcGy+r/kTWipfDlr5jms5TRsGGTHsND?= =?iso-8859-1?Q?sj3tZRkKgti1daG35UYWhk4Pu97npd4LLQ1lUzYIognG9UIcE5Uboiukgi?= =?iso-8859-1?Q?0sS2RXhEFZWti3uGNVhPu0dpJYSBMu77t/61RYBpbt+s3DIttR+Z/oE84C?= =?iso-8859-1?Q?rX1 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA1PR01MB6605.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?bHD/lSoGyyEFXMo1z1lhukIrVlAF/oa7rbAz/4UY5wUa3XDUyb21rWWsKF?= =?iso-8859-1?Q?lVvRzoPJ9vFhVSQwtNwvhkKKd5Llu+vMT5V7qG2+0msWH/SMH+9NSiRQfy?= =?iso-8859-1?Q?BlfEeiS6ToclQDQliE/BeMgv2uzYTLdaks4O/OK8WRNTCoYgwES+jkhtHO?= =?iso-8859-1?Q?1m9bDCkpOf4olSKZ2XQ8LoaiSHxSy6F4KX1CBBw4jknvVFAqMg9LuV3SX+?= =?iso-8859-1?Q?7Zmpd5oRIZlCEPGK+XGhT2q6VETqH5cHc312nBhxtlVjCmnlQ/gfh8R8b6?= =?iso-8859-1?Q?VG6PnIM3O0LGtNStChXgHYMAwChko7AZ6pZG6KKmuN19tREgfiGjIYd5Ts?= =?iso-8859-1?Q?gRmCIyAwO9oqC3zzOR+ZJ96WIpDc4CcIr2FUPCm5MkPaMMqrqEOgxS89/6?= =?iso-8859-1?Q?jl6YeJVLgTj0Ztg4KTJi/h3efTSaLd5bpRU277oWgV+hFIhZdz1xNnND//?= =?iso-8859-1?Q?YWeKYW8O12D87y7RMYn2HdvcG4zyGlFBD6w6/6d5Xj6mcfYjHRBRYpmqxQ?= =?iso-8859-1?Q?SDzVdyECXVVVOrOIvK4pBzySrMvJcXCU0h0kv5OsuxDJm8sMoKLB2yWH07?= =?iso-8859-1?Q?USU6e9DHC7BapyjSz8z9XAyhrR2QbeSKWiLis9eBojjmARAVfJRi74IpfV?= =?iso-8859-1?Q? X-OriginatorOrg: missouristate.edu X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SA1PR01MB6605.prod.exchangelabs.com X-MS-Exchange-CrossTenant-Network-Message-Id: b51464c4-f7b0-4e58-2548-08dc687c9893 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Apr 2024 18:45:52.4331 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: cad830e4-554f-4361-bae5-c865233fb77f X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CawDauapx8DJqWtzl9g+D/mpwM5SyPIw1Ct13/CU11tSlDaWnyG4G1nBu0iGZjCFj5AaUDZIwY0y9fWtxVYe9M4aMnZi8IevL8aTKds05VQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR01MB7618 Received-SPF: pass client-ip=40.107.94.126; envelope-from=JLambert@MissouriState.edu; helo=NAM10-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 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:146502 Archived-At: Thank you for the time. What you said gives me some hope but I have a follo= w-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 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 somethin= g similar. 3. Edit the records where understandable and possible. 4. Save file. 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 th= e buffer after using find-file-literally or would it be better to do that u= sing hexl-mode, or another method? Thanks, Joshua ________________________________ From: help-gnu-emacs-bounces+jlambert=3Dmissouristate.edu@gnu.org on behalf of Eli Zaret= skii Sent: Monday, April 29, 2024 2:22 AM To: help-gnu-emacs@gnu.org Subject: Re: Multiple encodings in one file CAUTION: External Sender > From: "Lambert, Joshua D" > 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 c= haracter 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. This message originated outside Missouri State University. Please use cauti= on when opening attachments, clicking links, or replying.