Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mc-butler opened this issue Nov 12, 2010 · 14 comments
Closed
Assignees
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress ver: 4.7.4 Reproducible in version 4.7.4
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/2417
Reporter ziv (f2404@….ru)
Mentions gotar@….pl
Keywords search, mcedit, encoding

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;

Note

Original attachments:

  • mc.png (raw) by ziv (f2404@….ru) on Nov 12, 2010 at 11:38 UTC
@mc-butler
Copy link
Author

Changed by ziv (f2404@….ru) on Nov 12, 2010 at 11:38 UTC

A screenshot with garbage in the search field

@mc-butler
Copy link
Author

Changed by ziv (f2404@….ru) on Nov 12, 2010 at 11:54 UTC (comment 1)

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

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 13, 2010 at 21:28 UTC (comment 2)

  • Cc set to gotar@….pl
  • Component changed from mc-core to mcedit

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

@mc-butler
Copy link
Author

Changed by ziv (f2404@….ru) on Nov 17, 2010 at 7:30 UTC (comment 2.3)

Replying to gotar:

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

Anyone with ru_RU.utf8 to test?

@mc-butler
Copy link
Author

Changed by gotar (gotar@….pl) on Nov 17, 2010 at 7:36 UTC (comment 3.4)

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.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 17, 2010 at 7:48 UTC (comment 4.5)

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().

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 17, 2010 at 13:16 UTC (comment 6)

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

Created 2417_edit_search_charset branch. Parent branch is master.
Initial [945e77a6cb9ba27a101e852dfde8a2a9625d9b85]

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 17, 2010 at 13:37 UTC

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 17, 2010 at 13:38 UTC (comment 8)

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

@mc-butler
Copy link
Author

Changed by angel_il (@ilia-maslakov) on Nov 21, 2010 at 20:22 UTC (comment 9)

  • Votes set to angel_il

@mc-butler
Copy link
Author

Changed by slavazanko (@slavaz) on Nov 22, 2010 at 12:31 UTC (comment 10)

  • Severity changed from on review to approved
  • Votes changed from angel_il to angel_il slavazanko

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 22, 2010 at 13:05 UTC (comment 11)

  • Votes changed from angel_il slavazanko to committed-master
  • Blocking #1856 deleted
  • Resolution set to fixed
  • Severity changed from approved to merged
  • Status changed from accepted to testing

Merged to master.
[58ea06d]

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

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Nov 22, 2010 at 13:05 UTC (comment 12)

  • Status changed from testing to closed

@mc-butler
Copy link
Author

Changed by ziv (f2404@….ru) on Nov 22, 2010 at 13:58 UTC (comment 13)

It works. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: mcedit mcedit, the built-in text editor prio: medium Has the potential to affect progress ver: 4.7.4 Reproducible in version 4.7.4
Development

No branches or pull requests

2 participants