Ticket #1629: mc-4.7.0.2-utf8-nroff-proof-of-concept.patch

File mc-4.7.0.2-utf8-nroff-proof-of-concept.patch, 1.2 KB (added by egmont, 15 years ago)
  • src/viewer/nroff.c

    diff -ur mc-4.7.0.2.orig/src/viewer/nroff.c mc-4.7.0.2/src/viewer/nroff.c
    old new  
    103103 
    104104        if (c == '\b') { 
    105105            if (from > 1) { 
    106                 mcview_get_byte (view, from - 2, &c_prev); 
     106#ifdef HAVE_CHARSET 
     107                if (view->utf8) { 
     108                    gboolean read_res; 
     109                    c_next = mcview_get_utf (view, from, &cw, &read_res); 
     110                } else 
     111#endif 
    107112                mcview_get_byte (view, from, &c_next); 
    108113            } 
    109             if (g_ascii_isprint (c_prev) && g_ascii_isprint (c_prev) 
     114            if (g_unichar_isprint (c_prev) && g_unichar_isprint (c_prev) 
    110115                && (c_prev == c_next || c_prev == '_' || (c_prev == '+' && c_next == 'o'))) { 
    111116                if (col == 0) { 
    112117                    if (row == 0) { 
     
    159164            tty_setcolor (SELECTED_COLOR); 
    160165        } 
    161166 
     167        c_prev = c; 
     168 
    162169        if (col >= view->dpy_text_column && col - view->dpy_text_column < width) { 
    163170            widget_move (view, top + row, left + (col - view->dpy_text_column)); 
    164171#ifdef HAVE_CHARSET