bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#4047: 23.1.1: hexl-mode doesn't like UTF8 files with a byte-order ma


From: Kenichi Handa
Subject: bug#4047: 23.1.1: hexl-mode doesn't like UTF8 files with a byte-order mark
Date: Thu, 27 Aug 2009 20:15:49 +0900

In article <address@hidden>, Eli Zaretskii <address@hidden> writes:

> > At the moment, all I can say is that changing
> > coding.h:encode_coding_string is quite safe.  But,
> > encode_coding_object is used by Lisp functions
> > encode-coding-region and encode-coding-string, and thus the
> > change will break some packages that use them on unibyte
> > string/buffer.

> I fixed this in encode-coding-string.

I have overlooked this part:

Stefan wrote:
> I'd recommend we change encode_coding_string to be
> a nop on unibyte strings (tho, we may want to let it obey EOL
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> conversions).
  ^^^^^^^^^^^

We surely need eol conversion in sending a unibyte string to
a process.  So, I've just installed this change.

2009-08-27  Kenichi Handa  <address@hidden>

        * process.c (send_process): Use encode_coding_object instead of
        encode_coding_string to perform eol-conversion even if the string
        is unibyte.

Index: process.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/process.c,v
retrieving revision 1.593
retrieving revision 1.594
diff -u -r1.593 -r1.594
--- process.c   17 Aug 2009 21:04:07 -0000      1.593
+++ process.c   27 Aug 2009 11:12:54 -0000      1.594
@@ -5721,7 +5721,8 @@
        }
       else if (STRINGP (object))
        {
-         encode_coding_string (coding, object, 1);
+         encode_coding_object (coding, object, 0, 0, SCHARS (object),
+                               SBYTES (object), Qt);
        }
       else
        {

---
Kenichi Handa
address@hidden





reply via email to

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