Function: dbus-string-to-byte-array

dbus-string-to-byte-array is a byte-compiled function defined in dbus.el.gz.

Signature

(dbus-string-to-byte-array STRING)

Documentation

Transform STRING to list (:array :byte C1 :byte C2 ...).

The resulting byte array contains the raw bytes of the UTF-8 encoded STRING.

Probably introduced at or before Emacs version 30.1.

Source Code

;; Defined in /usr/src/emacs/lisp/net/dbus.el.gz
;;; D-Bus type conversion.

(defun dbus-string-to-byte-array (string)
  "Transform STRING to list (:array :byte C1 :byte C2 ...).
The resulting byte array contains the raw bytes of the UTF-8 encoded
STRING."
  (if (length= string 0)
      '(:array :signature "y")
    (cons :array
          (mapcan (lambda (c) (list :byte c))
                  (let (last-coding-system-used)
                    (encode-coding-string string 'utf-8 'nocopy))))))