Fwd: utf8 patch for mc, slang 2 version
Hmm, sorry for splitting my email to two parts, but Gmail has keyboard shortcuts too... *** So I've Ubuntu too, I aliened the FC4 mc rpm version to it, but: - it said, it needs glibc 2.3.5 for Utf-8 operations - and requires the slang2 library, which was unavaliable. anyway I patched up slang according to the FC4 repository, but things didn't seem to be better... Does anyone have a proper source code for a *working* Utf-8 Midnight Commander? Regards, Balint On 19/09/05, Bart Oldeman [EMAIL PROTECTED] wrote: On Mon, 19 Sep 2005, Arkadiusz Miskiewicz wrote: There are few patches adding UTF-8 support to mc available but they require modified slang1 library. There is already stable slang-2 version with native UTF-8 support. Does anyone know mc utf8 patch that uses slang-2 ?No, but it's not too hard too change the existing patch.Basically you'd need to apply Fedora's patch, and then (sorry no proper patch here but it's not a big deal)in slint.c, use SLtt_get_terminfo()+#if SLANG_VERSION = 2+ SLutf8_enable (-1);+#endifin help.c, use#if defined(UTF8) SLANG_VERSION 2 SLsmg_draw_object (h-y + line + 2, h-x + col + 2, acs_map [c]);#elseSLsmg_draw_object (h-y + line + 2, h-x + col + 2, c);#endif /* UTF8 */and then (possibly global.h isn't the best place though):--- mc/src/util.c 2005-09-18 22:36:30.0 +1200+++ mc-utf8/src/util.c2005-08-26 13:04: 45.0 +1200@@ -48,6 +51,14 @@static const char app_text [] = Midnight-Commander;int easy_patterns = 1;+#if SLANG_VERSION = 2+void SLsmg_write_nwchars(wchar_t *s, size_t n) +{+while(n--)+SLsmg_write_char(*s++);+}+#endif+extern void str_replace(char *s, char from, char to){for (; *s != '\0'; s++) {@@ -78,9 +89,40 @@--- mc/src/global.h 2005-08-27 15:51: 32.0 +1200+++ mc-utf8/src/global.h2005-07-13 01:15:40.0 +1200@@ -146,6 +146,13 @@# define N_(String) (String)#endif /* !ENABLE_NLS */+#include slang.h+#if SLANG_VERSION = 2 +#define UTF8 1+#define SLsmg_Is_Unicode SLsmg_is_utf8_mode()+void SLsmg_write_nwchars(wchar_t *s, size_t n);+#endif+#include fs.h#include util.h___ Mc-devel mailing listhttp://mail.gnome.org/mailman/listinfo/mc-devel ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: utf8 patch for mc, slang 2 version
Hi Folks, sorry for bothering, I'm just a newbie, who tries to have UTF-8 MC on his OS X. I've downloaded the latest source, compiled, it was errorous. I have Fedora, and their MC far more better, but I just can not reproduce it on my Mac. I've downloaded from the CVS all FC4 patches and applied to 4.6.1, (according to the sources file, they used 4.6.1-pre5) BUT nothing really changed. The GUI is/was properly encoded (LANG=hu_HU.UTF-8), but the folder list is still wicked. I've Ubuntu too, I aliened the FC4 mc rpm version to it, but: On 19/09/05, Bart Oldeman [EMAIL PROTECTED] wrote: On Mon, 19 Sep 2005, Arkadiusz Miskiewicz wrote: There are few patches adding UTF-8 support to mc available but they require modified slang1 library. There is already stable slang-2 version with native UTF-8 support. Does anyone know mc utf8 patch that uses slang-2 ?No, but it's not too hard too change the existing patch.Basically you'd need to apply Fedora's patch, and then (sorry no proper patch here but it's not a big deal)in slint.c, use SLtt_get_terminfo()+#if SLANG_VERSION = 2+ SLutf8_enable (-1);+#endifin help.c, use#if defined(UTF8) SLANG_VERSION 2 SLsmg_draw_object (h-y + line + 2, h-x + col + 2, acs_map [c]);#elseSLsmg_draw_object (h-y + line + 2, h-x + col + 2, c);#endif /* UTF8 */and then (possibly global.h isn't the best place though):--- mc/src/util.c 2005-09-18 22:36:30.0 +1200+++ mc-utf8/src/util.c2005-08-26 13:04: 45.0 +1200@@ -48,6 +51,14 @@static const char app_text [] = Midnight-Commander;int easy_patterns = 1;+#if SLANG_VERSION = 2+void SLsmg_write_nwchars(wchar_t *s, size_t n) +{+while(n--)+SLsmg_write_char(*s++);+}+#endif+extern void str_replace(char *s, char from, char to){for (; *s != '\0'; s++) {@@ -78,9 +89,40 @@--- mc/src/global.h 2005-08-27 15:51: 32.0 +1200+++ mc-utf8/src/global.h2005-07-13 01:15:40.0 +1200@@ -146,6 +146,13 @@# define N_(String) (String)#endif /* !ENABLE_NLS */+#include slang.h+#if SLANG_VERSION = 2 +#define UTF8 1+#define SLsmg_Is_Unicode SLsmg_is_utf8_mode()+void SLsmg_write_nwchars(wchar_t *s, size_t n);+#endif+#include fs.h#include util.h___ Mc-devel mailing listhttp://mail.gnome.org/mailman/listinfo/mc-devel ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: utf8 patch for mc, slang 2 version
On Monday 19 of September 2005 22:14, Bart Oldeman wrote: Does anyone know mc utf8 patch that uses slang-2 ? No, but it's not too hard too change the existing patch. Basically you'd need to apply Fedora's patch, and then (sorry no proper patch here but it's not a big deal) Thanks, works. -- Arkadiusz MiśkiewiczPLD/Linux Team http://www.t17.ds.pwr.wroc.pl/~misiek/ http://ftp.pld-linux.org/ ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel
Re: utf8 patch for mc, slang 2 version
hi, Arkadiusz was kind enough to provide me the sourcecode, and I managed to compile it on my Mac (Darwin 8.2.0). But even with all patches and stuff, I see the following Unicode glitches: - the utf-8 chars are not diplayed in the dir list (on Ubuntu, everything is OK) for ÉÁŰŐÚÖÜÓ I see EAUOUOUO (upper, lowercase all wrong) - the files/dirs that contain the unicode chars, are still not properly aligned to the grids ( What could cause Darwin to behave such unpredictably? In the filesystem, there's another error: if you do 'ls', the alignment of the columns after the unicode chars are broken as well. (where can I find the source code for the ls command? what package on other linux distributions?) ) - I've lost the functionality of the Arrow keys, it just types ABCD. (so I use screen) problem on both Linux/Darwin: if you cd into a unicode-named directory, the blinking command prompt will be positioned to the right with spaces, as much unicode chars you have in the dir name. for example: ~/ÉÁŰŐÚÖÜÓ [] Kind regards, Balint ___ Mc-devel mailing list http://mail.gnome.org/mailman/listinfo/mc-devel