;; KATAYAMA Yoshio <kate@pfu.co.jp> ; Korean, Chinese support.
;; Maintainer: NIIBE Yutaka <gniibe@mri.co.jp>
-;; This file will be part of GNU Emacs (in future).
+;; This file is part of EGG.
;; EGG is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
'progn
result)))
\f
+(if (not (fboundp 'string-as-multibyte))
+ (defsubst string-as-multibyte (str)
+ str))
+
;; Do not move the point, leave it where it was.
(defun comm-accept-process-output (proc)
(let ((p (point)))
(let ((start (point)))
(while (not (search-forward "\0\0" nil t))
(comm-accept-process-output proc))
- (set s (buffer-substring start
- (+ start
- (decode-coding-region start (- (point) 2)
- egg-fixed-euc))))))
+ (set s (string-as-multibyte
+ (buffer-substring start
+ (+ start
+ (decode-coding-region start (- (point) 2)
+ egg-fixed-euc)))))))
;;; XXX should support other conversion (euc-kr, cns)
(defsubst comm-unpack-mb-string (proc s)
(let ((start (point)))
(while (not (search-forward "\0" nil t))
(comm-accept-process-output proc))
- (set s (buffer-substring start
- (+ start
- (decode-coding-region start (- (point) 1)
- egg-mb-euc))))))
+ (set s (string-as-multibyte
+ (buffer-substring start
+ (+ start
+ (decode-coding-region start (- (point) 1)
+ egg-mb-euc)))))))
(defsubst comm-unpack-u8-string (proc s)
(let ((start (point)))