Re: [code] v strange find/replace behaviour

From: Thomas Lauer <thomas.lauer.att.virgin.net>
Date: Mon, 27 Aug 2018 13:51:47 +0100

Hi Mitchell,

the file is in UTF-8 and TA correctly recognise and displays it as such
(that was my first hunch as well).

However (as these files came way back in the past from a Windows
machine), it does have a BOM. And it seems that indeed that BOM is not
removed but stays in the text (though not visible) and is copied with
the text I select. If I

a) start selecting in the second line or
b) hexedit the BOM away and retry in the first line

it all works.

So... although the BOM is not visible (on screen) it is still there and
can be copied!?

Cheers Tom

 ----original message----
From: Mitchell <m.att.foicica.com>
Date: Mon, 27 Aug 2018 08:35:50 -0400 (EDT)
Subj: Re: [code] v strange find/replace behaviour
> Hi Thomas,
>
> On Mon, 27 Aug 2018, Thomas Lauer wrote:
>
> > I am pretty new to TA and so far things have been looking good. However,
> > I've just run into something that's utterly puzzling. This happens with
> > a fresh install of TA x86_64 (ie no changes in the textadept directory)
> > on a Debian-based system.
> >
> > I have a few largish files with filenames for music titles (m3u8). The
> > names all look like this:
> >
> > /dir/dir2/Music/MusicM4A/Artist/Album/Title.m4a or
> > /dir/dir2/Music/MusicMP3/Artist/Album/Title.mp3
> >
> > ie they all start with either /dir/dir2/Music/MusicM4A/ or
> > /dir/dir2/Music/MusicMP3/.
> >
> > I load one of those files with say 500 titles (ie 500 lines). I go to
> > the first line and select the part "/dir/dir2/Music/MusicM4A/" with the
> > mouse and copy it to the clipboard (Ctrl-C). I press Ctrl-F, enter the
> > copied string into the Find field (Ctrl-V)and press Find Next
> > repeatedly. This does absolutely nothing.
> >
> > However, if I clear the Find field and enter the *exact same string*
> > manually, ie character for character, Find Next works. It also
> > sometimes, not always, works if I remove the first / character after
> > copying from the clipboard.
> >
> > This is so strange that I'm inclined to think it's a problem with my
> > installation.
>
> I doubt it's an installation issue.
>
> > Can anyone reproduce that and if so, any ideas as to what might be the
> > problem?
>
> I can think of two things: encoding issue, or copy-pasted text is not what you expect.
>
> What encoding is your file in? You can use the Buffer -> Encoding menu to try temporarily changing to ASCII or ISO-8859-1 and then copy-pasting your text to search for (just don't save, which will commit any encoding changes). I'm wondering if your file has a UTF-8 BOM and that's accidentally being copied. Does this happen for other lines? (Not just the first.)
>
> Open a new buffer and paste what you just copied and inspect it character by character. Tools -> Show Style also shows character bytes, which can help identify multi-byte UTF-8 characters you did not expect to see.
>
> Cheers,
> Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 27 Aug 2018 - 08:51:47 EDT

This archive was generated by hypermail 2.2.0 : Tue 28 Aug 2018 - 06:27:37 EDT