Ticket #2417 (closed defect: fixed)

Opened 14 years ago

Last modified 14 years ago

String in the editor's search field turns into garbage after reopening editor

Reported by: ziv Owned by: andrew_b
Priority: major Milestone: 4.7.5
Component: mcedit Version: 4.7.4
Keywords: search, mcedit, encoding Cc: gotar@…
Blocked By: Blocking:
Branch state: Votes for changeset: committed-master

Description

Actually, I'm not sure if it's a bug or rather an enhancement.

How to reproduce:

  1. open a file in mcedit;
  2. change encoding to any national one that is different from your system's locale (let's say, locale is ru_RU.utf8 and the file is in cp1251) using Alt+E;
  3. search for some string in your language (Russian in our case) using F7;
  4. exit mcedit;
  5. open the same file or any other in mcedit;
  6. press F7 to search.

You see garbage instead of your previous searched string. And you have to press Ctrl+Down to get it back. It's very annoying.

$ LC_ALL=C mc -V
GNU Midnight Commander unknown
Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish
With builtin Editor
Using system-installed S-Lang library with terminfo database
With subshell support as default
With support for background operations
With mouse support on xterm
With internationalization support
With multiple codepages support
Data types: char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 64;

Attachments

mc.png (74.7 KB) - added by ziv 14 years ago.
A screenshot with garbage in the search field

Change History

Changed 14 years ago by ziv

A screenshot with garbage in the search field

comment:1 Changed 14 years ago by ziv

BTW, the same search string is shown correctly in the viewer.

comment:2 follow-up: ↓ 3 Changed 14 years ago by gotar

  • Cc gotar@… added
  • Component changed from mc-core to mcedit

Couldn't reproduce it with ISO-8859-2 and CP1250.

comment:3 in reply to: ↑ 2 ; follow-up: ↓ 4 Changed 14 years ago by ziv

Replying to gotar:

Couldn't reproduce it with ISO-8859-2 and CP1250.

Anyone with ru_RU.utf8 to test?

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 14 years ago by gotar

Replying to ziv:

Couldn't reproduce it with ISO-8859-2 and CP1250.

Anyone with ru_RU.utf8 to test?

You shoud try yourself with e.g. KOI8-R and CP1251, this might be UTF-related due to multibyte all russian characters.

comment:5 in reply to: ↑ 4 Changed 14 years ago by andrew_b

Replying to gotar:

this might be UTF-related due to multibyte all russian characters.

No, this is not utf-related. It is always reproducable bug. There is an incorrect charset conversion in edit_search_cmd().

comment:6 Changed 14 years ago by andrew_b

  • Status changed from new to accepted
  • Owner set to andrew_b
  • severity changed from no branch to on review
  • Milestone changed from 4.7 to 4.7.5

Created 2417_edit_search_charset branch. Parent branch is master.
Initial changeset:945e77a6cb9ba27a101e852dfde8a2a9625d9b85

comment:7 Changed 14 years ago by andrew_b

  • Blocking 1856 added

(In #1856) It will be fixed in #2417.

comment:8 Changed 14 years ago by andrew_b

Actually, this ticket is duplicate of #1856. But branch ia already created for this ticket...

comment:9 Changed 14 years ago by angel_il

  • Votes for changeset set to angel_il

comment:10 Changed 14 years ago by slavazanko

  • Votes for changeset changed from angel_il to angel_il slavazanko
  • severity changed from on review to approved

comment:11 Changed 14 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from angel_il slavazanko to committed-master
  • Resolution set to fixed
  • Blocking 1856 removed
  • severity changed from approved to merged

Merged to master.
changeset:58ea06dadf952a0a1e9d96efb5699721d101df1a

git log --pretty=oneline a14974b..58ea06d

comment:12 Changed 14 years ago by andrew_b

  • Status changed from testing to closed

comment:13 Changed 14 years ago by ziv

It works. Thanks!

Note: See TracTickets for help on using tickets.