bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#9318: 23.3.50; The first call of encode-coding-region() returns wron


From: Kazuhiro Ito
Subject: bug#9318: 23.3.50; The first call of encode-coding-region() returns wrong result on on Windows
Date: Thu, 18 Aug 2011 18:01:13 +0900
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.8 EasyPG/1.0.0 Emacs/23.3.50 (i386-mingw-nt6.1.7601) MULE/6.0 (HANACHIRUSATO)

When I start Emacs and evaluate the below code, unexpected result returns.

(let ((func (lambda ()
              (with-temp-buffer
                (mapc 'insert '(166 25339))
                (encode-coding-region (point-min) (point-max) 'ctext-unix)
                (buffer-string)))))
  (cons (funcall func)
        (funcall func)))
-> ("¦拻^@^@^@^@^@^@^@^@^@^@" . "^[$(D\"C^[$(H*f^[(B") 

car of the result is not constant.  In the worst case, emacs
crashes.  It doesn't occur on Linux.  If I evaluate twice, car and cdr
of the last result are correct.  Using encode-coding-string instead of
encode-coding-region has no problem. 

(let ((func (lambda ()
              (encode-coding-string
               (mapconcat 'char-to-string '(166 25339) "")
               'ctext-unix))))
  (cons (funcall func)
        (funcall func)))
-> ("^[$(D\"C^[$(H*f^[(B" . "^[$(D\"C^[$(H*f^[(B")

Before calling encode-coding-string also can avoid problem.

(let ((func (lambda ()
              (with-temp-buffer
                (mapc 'insert '(166 25339))
                (encode-coding-region (point-min) (point-max) 'ctext-unix)
                (buffer-string)))))
  (encode-coding-string
   (mapconcat 'char-to-string '(166 25339) "") 'ctext-unix)
  (cons (funcall func)
        (funcall func)))
-> ("^[$(D\"C^[$(H*f^[(B" . "^[$(D\"C^[$(H*f^[(B")

-- 
Kazuhiro Ito





reply via email to

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