Midnight Commander within console in UTF-8 mode

Andy Rysin arysin at yahoo.com
Mon Oct 22 06:18:32 UTC 2001


Hello, Pavel!

--- Pavel Roskin <proski at gnu.org> wrote:
> > I've been trying to run MC under console in UTF-8 mode and MC
> breaks
> > in some places displaying non-latin symbols.
> > I've tried it with xterm and konsole, putting
> > $ export LC_ALL=uk_UA.UTF-8
> > $ echo -en "\\033%G"
> > 
> > after these two commands console works just fine with any symbols
> but
> > MC have some glitches. 
> > I'm using MC-4.5.55 under Mandrake 8.1.
> 
> I believe that we should to make sure first that "ls -l" works
> correctly
> under the same conditions.  It would be wrong to fix in MC problems
> that
> are not MC-specific.  It's very well possible that there is more
> than one 
> problem, so it's important to separate them.
I mentioned that, but probably I should be more specific - in this
mode console commands work just fine. All the "ls -l", "date" work
fine and display all set of symbols for current locale OK, and when I
try to do "more utf8.txt" it's just fine as well, and the file is in
UTF-8 mode. Console itself does all (well, most :) tricks to keep
UTF-8 display correctly.
MC does show some (e.g. cyrillic) symbols but others just break it
somehow.

> Secondly, MC has absolutely no support to the characters of
> variable
> lenght.  With UTF-8, you can have 2 bytes representing one
> character,
> which can be as wide as one or two latin characters (the later is
> unlikely
> in Ukrainian, by may happen e.g. in Japanese).  MC assumes that one
> byte 
> is one character wide (see e.g. name_trunc in src/util.c).
Actually all non-ASCII (incl. cyrillic) symbols take 2 bytes in UTF-8
or even 2-3-... in Korean, Japaneese etc.
I don't know how much output of console and MC differ but the code
can always be borrowed as far as it's GPL. May be this is more the
issue with Curses library and less with MC itself.
But if the world is moving to Unicode this should be done somehow.

> Correcting this assumption will require significant efforts. 
> Patches are
> welcome, as usually.
I would gladly participate in MC development but it would take pretty
much time to get into it and I can not do that right now. Otherwise -
testing, translating... I'm at your service.

> Another smaller problem is that the hints are always displayed in
> the same
> encoding.  It could be fixed by translating the hint files into
> UTF-8 and
> translating them to the currently used encoding at runtime.
That's what for example KDE team succesfully implemented - all
translated messages are in UTF-8. But anyway I agree - it's not the
main problem.

I can't live w/out MC and that's the only thing that stops me turning
completely to UTF, I just got enough of all those pesky encodings
(especially cyrillic set).

Take care,
Andriy

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



More information about the mc-devel mailing list