GNU bug report logs - #1215
23.0.60; unibyte->multibyte conversion problem (in search-forward and friends)

Previous Next

Package: emacs;

Reported by: "Eduardo Ochs" <eduardoochs <at> gmail.com>

Date: Tue, 21 Oct 2008 16:10:03 UTC

Severity: normal

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #10 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eduardo Ochs <eduardoochs <at> gmail.com>
Cc: 1215 <at> debbugs.gnu.org, emacs-pretest-bug <at> gnu.org
Subject: Re: bug#1215: 23.0.60; unibyte->multibyte conversion problem (in search-forward and friends)
Date: Wed, 22 Oct 2008 10:51:29 -0400
> Let me refer to strings like "<<tag>>" - where the "<<" and ">>" stand
> for guillemets, i.e., the characters that we type with `C-x 8 <' and
> `C-x 8 >' - as "anchors". So: if I produce an anchor string in a
> unibyte buffer and then I search for an occurrence of that string in
> multibyte buffer, the search fails.

There are no guillemets in unibyte buffers.

> ;;--------snip,snip--------
> ;; -*- coding: raw-text-unix -*-
> ;; (save-this-block-as "/tmp/1.txt")
> (progn
>   (find-file "/tmp/2.txt")
>   (goto-char (point-min))
>   (setq anchorstr "«foo»")
>   (message (if (multibyte-string-p anchorstr) "multi" "uni"))
>   (search-forward anchorstr))

There's a bug here, indeed: Emacs should refuse to save such a file,
because raw-text-unix (to which I prefer to refer as `binary') cannot
encode « and ».


        Stefan




This bug report was last modified 15 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.