Fwd: utf8 patch for mc, slang 2 version
- From: Bálint Kardos <kardosbalint gmail com>
- To: mc-devel gnome org
- Subject: Fwd: utf8 patch for mc, slang 2 version
- Date: Tue, 20 Sep 2005 10:45:55 +0200
****
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 <
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]