Quoting fixes
[gnus] / lisp / gnus-compat.el
index 86bcb8f..b96a6ac 100644 (file)
@@ -146,8 +146,22 @@ one is kept."
 
 (unless (fboundp 'string-bytes)
   (defun string-bytes (string)
-    ;; This is a rather wrong definition that should be fixed.
-    (length string)))
+    (length (if (or (mm-coding-system-p 'utf-8)
+                   (ignore-errors
+                     (let (mucs-ignore-version-incompatibilities)
+                       (require 'un-define))))
+               (mm-encode-coding-string string 'utf-8)
+             string))))
+
+(unless (fboundp 'process-live-p)
+  (defun process-live-p (process)
+    "Returns non-nil if PROCESS is alive.
+A process is considered alive if its status is `run', `open',
+`listen', `connect' or `stop'.  Value is nil if PROCESS is not a
+process."
+    (and (processp process)
+        (memq (process-status process)
+              '(run open listen connect stop)))))
 
 (provide 'gnus-compat)