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

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

(replace-regexp-in-string ...) gets a weird result.


From: yu jie
Subject: (replace-regexp-in-string ...) gets a weird result.
Date: Wed, 27 Dec 2006 10:55:00 +0800

--text follows this line--

Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the address@hidden mailing list.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:
 
==========================================================
Test Cases:
----------------------------------------------------------------------------------
 (defun test (f)
  (prin1
   (replace-regexp-in-string
   "%[a-zA-Z0-9][a-zA-Z0-9]"
   (lambda (arg)
     (let ((str (make-string 1 0)))
       (aset str 0 (string-to-number (substring arg 1) 16))
       str))
   f nil t)))
  (test "%C8%EB")  ;;case 1
  (test "%c8%eb")   ;;case 2
-------------------------------------------------------------------------------------
 
in each test case, the lambda function will be called twice and the return value is in the following table:
-------------------------------------
              %C8       %EB
case 1    "\310"      "\353"
case 2    "\310"      "\353"
--------------------------------------
both get the same result, but the return value of the (replace-regexp-in-string ...) is different:
--------------------------------------
case1     "\310\313"
case2     "\310\353"
--------------------------------------
 
=================================================================== 

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
d:/ntemacs23/etc/DEBUG for instructions.


In GNU Emacs 23.0.0.1 (i386-mingw-nt5.1.2600)
 of 2006-12-22 on MACROSS-GG9FRPF
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc ( 3.2)'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp936
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  show-paren-mode: t
  encoded-kbd-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>
<help-echo> <help-echo> <menu-bar> <help-menu> <re
port-emacs-bug>

Recent messages:
(D:\ntemacs23\bin\emacs.exe)
Loading encoded-kb...done
Toggling tool-bar-mode off; better pass an explicit argument.
Loading paren...done
Loading edmacro...done
Loading cl-macs...done
For information about the GNU Project and its goals, type C-h C-p.
Loading emacsbug...
Loading regexp-opt...done
Loading emacsbug...done


reply via email to

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