[Top][All Lists]

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

Re: docs for insert-file-contents use 'bytes'

From: Eli Zaretskii
Subject: Re: docs for insert-file-contents use 'bytes'
Date: Mon, 29 Sep 2008 23:12:58 +0300

> From: Ted Zlatanov <address@hidden>
> Date: Mon, 29 Sep 2008 14:58:17 -0500
> The docs for insert-file-contents say the range is in bytes, but that
> function does decoding of the contents.  Can it, therefore, read from an
> undesirable position (e.g. the middle of a UTF-8 sequence)?

The range _is_ in bytes (you will see in fileio.c that Emacs uses
`lseek' to get to the required file positions).  Yes, reading a part
of a multibyte sequence is a possibility.

> How does Emacs handle that?

Like with any other random bytes, I think: it will produce eight-bit-*
characters in the buffer.  IOW, you get garbled text.

> Either way the docs need to state the operation mode clearly.

Assuming I don't miss anything, and the above is indeed correct, what
would you like the doc string to say, exactly?

reply via email to

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