[Top][All Lists]

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

Re: translate-region bug

From: Kenichi Handa
Subject: Re: translate-region bug
Date: Mon, 1 Mar 2004 15:43:05 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

I'm sorry for this late response.

In article <address@hidden>, Richard Stallman <address@hidden> writes:

> Can you take a look at this?


> To: address@hidden
> From: Jesper Harder <address@hidden>
> Date: Tue, 24 Feb 2004 15:00:28 +0100
> Subject: translate-region bug
> Sender: address@hidden

> `translate-region' doesn't work correctly for multibyte characters.
> For example:

> (let ((table (make-string 256 ?y)))
>   (setf (aref table ?a) ?\201?\240)
>   (with-temp-buffer
>     (insert "abra")
>     (translate-region (point-min) (point-max) table)
>     (buffer-string)))

>   => "\x9c\xf4ye"

Thank you for the report.   I've just installed a fix for
handling multibyte characters in translate-region.  But,
it seems that your example above arrived at me as above, and
I couldn't run it.

If your code intended to do this:

(let ((table (make-string 256 ?y)))
  (aset table ?a (decode-char 'ucs #xa0)) ;; NBSP
    (insert "abra")
    (translate-region (point-min) (point-max) table)

I confirmed that the new code returns a string of characters
NBSP 'y' 'y' NBSP.

Ken'ichi HANDA

reply via email to

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