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 <bartoldeman users sourceforge net> 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 >= 20000
+ SLutf8_enable (-1);
+#endif

in help.c, use

#if defined(UTF8) && SLANG_VERSION < 20000
                        SLsmg_draw_object (h->y + line + 2, h->x + col + 2, acs_map [c]);
#else
                        SLsmg_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.000000000 +1200
+++ mc-utf8/src/util.c  2005-08-26 13:04: 45.000000000 +1200
@@ -48,6 +51,14 @@
  static const char app_text [] = "Midnight-Commander";
  int easy_patterns = 1;

+#if SLANG_VERSION >= 20000
+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.000000000 +1200
+++ mc-utf8/src/global.h        2005-07-13 01:15:40.000000000 +1200
@@ -146,6 +146,13 @@
  #   define N_(String) (String)
  #endif /* !ENABLE_NLS */

+#include <slang.h>
+#if SLANG_VERSION >= 20000
+#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 list
http://mail.gnome.org/mailman/listinfo/mc-devel



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]