LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-06-2020, 06:45 AM   #1
sunjob
Member
 
Registered: Nov 2015
Posts: 60

Rep: Reputation: Disabled
Midnight Commander does not display content correctly / wrong/codepage on F3


good day!

Midnight Commander does not display content correctly !!! one and the same !!! HTML pages when viewed by the internal viewer on F3

MC periodically update
check all my/builds 4.8.x-version of MC, bug is present

clear all settings/directory - did not help

links, thoughts, ideas, key. words ...

thanks

mc-4.8.23

https://postimg.cc/gallery/2u3klkd2g/

1st screen - view on F3 with the correct encoding (garbage)
2nd screen - editing on F4, and resp. installed same, correct encoding
viewing the same page

in the attachment - page archive (without pictures)
remove txt from extension
Attached Files
File Type: txt htm.tar.xz.txt (5.4 KB, 75 views)

Last edited by sunjob; 02-06-2020 at 07:18 AM.
 
Old 02-07-2020, 09:47 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 16,019
Blog Entries: 27

Rep: Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775Reputation: 4775
Let me make sure I understand this correctly.

Both screen shots show the same page, but in the first one it's garbled nonsense and in the second one it's not. Is that correct? If not, please straighten me out.

What editor did you configure mc to use?

Does the page show correctly when you open it directly with that editor? With other editors?

I doubt it's relevant, but what distro/version are you using?
 
Old 02-08-2020, 08:51 AM   #3
sunjob
Member
 
Registered: Nov 2015
Posts: 60

Original Poster
Rep: Reputation: Disabled
Quote:
Both screen shots show the same page, but in the first one it's garbled nonsense and in the second one it's not. Is that correct?
yes, but
Quote:
1 screen - F3 view
2 screen - F4 edit
comp1
slackware 12.2
mc-4.8.24-i486-sl12.2
links-2.14-i486-sl12.2
lynx-2.8.9-i486-sl12.2

comp2
slackware 14.1
mc-4.8.24
lynx-2.8.8
links-2.8

mc, links & lynx - build & install more version

different versions give different results, but they are all with a bug (unreadable text on F3)

###!!! UPDATE !!!###

solution found, a small bite from the logbook

1. save to a separate file, look
###!!! UPDATE !!!###
Code:
enconv -L ru_RU.UTF-8 < 1.html > 1.ru
lynx -display_charset=utf-8 -force_html 1.ru
garbage

2. try to configure lynx from the inside

setup:
Code:
O - options
Assumed document character set(!): [utf-8___________]
arrow up to apply:
Code:
"Accept Changes" (arrow to right, save)

Save options to disk: [X] (arrow to right)
ОК - view is TRUE, but can't save settings on exit

see to settings and comment to top
Code:
Assumed document character set(!): [iso-8859-1______]
options marked with (!) will not be saved
bravissimo!!!

3. what's with the golden key

Code:
lynx --help | grep charset
-assume_charset       = MIMEname charset for documents that don't specify it
-assume_local_charset = MIMEname charset assumed for local files
-assume_unrec_charset = MIMEname use this instead of unrecognized charsets
-display_charset      = MIMEname charset for the terminal output
-html5_charsets         toggles use of HTML5 charset replacements (off)

Code:
lynx -display_charset=UTF8 -assume_charset=utf-8 -force_html  1.ru
OK - view is TRUE

redirection - works OK
Code:
enconv -L ru_RU.UTF-8 < 1.html | lynx -dump -force_html -stdin -display_charset=UTF8 -assume_charset=utf-8
4. tuning mc
Code:
sudo mcedit /usr/libexec/mc/ext.d/web.sh
edit code this
Code:
do_view_action() {
  filetype=$1

  case "${filetype}" in
  html)
  enconv -L ru_RU.UTF-8 <  "${MC_EXT_FILENAME}" | lynx -dump -force_html -stdin -display_charset=UTF8 -assume_charset=utf-8 2>/dev/null || \
   lynx  -dump -force_html "${MC_EXT_FILENAME}" 2>/dev/null || \
   links -dump             "${MC_EXT_FILENAME}" 2>/dev/null || \
   w3m   -dump             "${MC_EXT_FILENAME}" 2>/dev/null || \
   cat "${MC_EXT_FILENAME}"
   ;;
   *) ;;
   esac
}
thanks for the help

Last edited by sunjob; 02-09-2020 at 01:50 AM. Reason: !
 
  


Reply

Tags
codepage, mc, view


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mount: wrong fs type, bad option, bad superblock missing codepage or other error twaddlac Linux - Virtualization and Cloud 3 09-29-2010 09:24 AM
Mount: wrong fs type, bad option, bad superblock missing codepage or other error twaddlac Red Hat 4 09-28-2010 04:45 AM
FAT: codepage cp850 not found guedellas Linux - Hardware 2 12-31-2005 09:04 AM
codepage erwin.meier Linux - General 0 10-06-2003 03:34 AM
Japanese codepage sourceman Linux - General 1 10-31-2002 09:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration