Find/Replace in Files & UTF-8

Post anything about TopStyle here. NOTE: TopStyle has been discontinued.

Moderator: TopStyle Support

Post Reply
jayaitch
Rank I - Novice
Rank I - Novice
Posts: 17
Joined: Fri Mar 30, 2012 3:14 pm

Find/Replace in Files & UTF-8

Post by jayaitch » Thu Jun 30, 2016 10:32 am

I suppose it is moot to ask about something which smells like a bug for a program that is dead and buried (or is it?). OTOH it may just be an extra setting which I have missed so far:

Searching in folders/subfolders (Edit->Find/Replace in Files / ctrl-shift-f) works fine with UTF-8 just as with ANSI characters and the match is highlighted on double click in the results pane. However, if there are UTF-8 characters left of the match, then the highlighted area is shifted to the right by as many characters as there are doublebyte characters left of it. IOW the highlighted area is no longer identical with the search match, which is quite a nuisance in the long run.

Replace in Files works correctly as far as the actual replace operation is concerned, only opening the documents from the results pane has the same shifting of highlighted area as above.

Plain Find Text search (Edit->Find / ctrl-f) on all open documents does not have this anomality.

In settings -> editor -> encoding auto-detect/meta tag/assume UTF-8 all checked (no BOM). Having had ANSI before was the same issue.

TopStyle version is 5.0.0.104 (final) on XP SP4 fully patched.

Notepad++'s Find in Files as a workaround works as regards the highlighting, however is rather buggy in opening the documents by double clicking in the results pane: sometimes the file opens, sometimes not, probably depending on the length of the line the match is in. Replace in Files not even gives a results list for checking. Besides, it is not just a clumsy and unreliable workaround, but Notepad++ is no longer free to use either.

TIA for any suggestions, even if it is just confirming the bug (which of course would be a suggestion, too, to get on the move again for a replacement for Homesite).

EDIT:
Attached a screenshot. Searchstring was "W. Hogarth" (w/o quotes), however, both the bold type in the results pane and the highlighting in the editor only start two characters later on the space before "Hogarth" and extends two chars beyond. Note that there are two umlauts in the line before the match, in Verkäuferin und Göttingen (line wrapping is on, but is irrelevant). Adding/removing high characters would shift the highlighted area accordingly (in a new search of course). The same search with Find... works fine, both with Find & Find All.

--

jayaitch
Attachments
Find-Replace_in_Files_and_UTF8.jpg
Sample showing the shift of highlighted area
Find-Replace_in_Files_and_UTF8.jpg (392.64 KiB) Viewed 2201 times
Last edited by jayaitch on Wed Jul 06, 2016 3:57 pm, edited 1 time in total.

User avatar
TopStyle Support
Rank VI - Professional
Rank VI - Professional
Posts: 507
Joined: Sat Jun 13, 2009 12:38 pm
Contact:

Re: Find/Replace in Files & UTF-8

Post by TopStyle Support » Tue Jul 05, 2016 10:55 am

Hello jayaitch

I'm sorry you are having this problem. Do you happen to have an example document for me maybe? I would love to reproduce and fix this problem.

Thanks!

--Stefan.

jayaitch
Rank I - Novice
Rank I - Novice
Posts: 17
Joined: Fri Mar 30, 2012 3:14 pm

Re: Find/Replace in Files & UTF-8

Post by jayaitch » Wed Jul 06, 2016 3:51 pm

Hello Stefan

Thanks for your reply. I have sent a sample off list and added a screenshot to the OP (can add the sample here, too, of course).

Looking forward to a fix!

--

jayaitch

User avatar
TopStyle Support
Rank VI - Professional
Rank VI - Professional
Posts: 507
Joined: Sat Jun 13, 2009 12:38 pm
Contact:

Re: Find/Replace in Files & UTF-8

Post by TopStyle Support » Tue Aug 02, 2016 12:51 pm

Hello jayaitch,

This bug has been fixed in version 5.0.0.108

Please download the 5.0.0.108 hot-fix here: https://www.htmlvalidator.com/topstyle

Thanks!

--Stefan.

jayaitch
Rank I - Novice
Rank I - Novice
Posts: 17
Joined: Fri Mar 30, 2012 3:14 pm

Re: Find/Replace in Files & UTF-8

Post by jayaitch » Tue Aug 02, 2016 3:04 pm

Hello Stefan,

many thanks for the fix and your effort as I know by the number of in-between hot fixes dealt with in direct contact.

As for standard Find/Replace in Files the fix works perfect, beside the two dozen test cases there has not been one single glitch during regular work these days now either.

I had not forgotten this thread, just wanted to wait a few days in case you would comment on my off-list message regarding Find in Files with regex.

Thanks,

--

jayaitch

Post Reply