Subject: Suspicious args-out-of-range in replace-match

From: Geoff Gole <[email-masked]>
Date: Sat, 6 Feb 2010 07:46:40 +0800

When given a replacement string containing multi-byte chars,
replace-match will report an unexpected error. There's no error if the
string is all ASCII.

To reproduce in an emacs -Q:

  RET
  foo
  C-p
  C-s foo RET
  M-: (replace-match "αβψ")

Where the string is not pasted, but typed with the greek input method.
The backtrace:

Debugger entered--Lisp error: (args-out-of-range 65052 65070)
  replace-match("\x03b1\x03b2\x03c8")
  eval((replace-match "\x03b1\x03b2\x03c8"))
  eval-expression((replace-match "\x03b1\x03b2\x03c8") nil)
  call-interactively(eval-expression nil nil)

GNU Emacs 23.1.50.1 (i686-pc-linux-gnu, GTK+ Version 2.12.11) of 2009-07-30

locale-coding-system is utf-8-unix, default-enable-multibyte-characters is t