all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Replacement for string-as-unibyte-function
@ 2021-01-31 23:01 Joe Riel
  2021-02-01  3:03 ` Stefan Monnier
  0 siblings, 1 reply; 12+ messages in thread
From: Joe Riel @ 2021-01-31 23:01 UTC (permalink / raw)
  To: help-gnu-emacs

Apologies for this partial duplicate; after posting realized I no longer
receive email from this group, so renewed.  Am copying and responding to response
from the website:

Eli Zaretskii asks:
> Please describe your use case: what are you trying to do that you
> needed string-as-unibyte?

Am handling a message passed in from an external process
(its passed in chunks).

The header of the message specifies its length, in bytes.
Some of the characters may be unicode.   Am using
buffer-substring-no-properties to later extract the message.
To get its length write, each byte has to be a character in the buffer.

It appears as though

   (encode-coding-string string 'utf-8-unix)

is the equivalent of (string-as-unibyte string).



-- 
Joe Riel




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-02-02 14:58 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-31 23:01 Replacement for string-as-unibyte-function Joe Riel
2021-02-01  3:03 ` Stefan Monnier
2021-02-01  5:55   ` Joe Riel
2021-02-01 14:53     ` Eli Zaretskii
2021-02-01 16:33       ` Joe Riel
2021-02-01 17:05         ` Eli Zaretskii
2021-02-01 23:43           ` Joe Riel
2021-02-02  3:30             ` Eli Zaretskii
2021-02-02  3:51               ` Joe Riel
2021-02-02 14:58                 ` Eli Zaretskii
2021-02-01 15:01     ` Stefan Monnier
2021-02-01 16:05       ` <somecodingsystem> (was: Re: Replacement for string-as-unibyte-function) moasenwood--- via Users list for the GNU Emacs text editor

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.