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

Re: multilingual man pages



Markus Kuhn <mgk25@xxxxxxxxx> writes:

>> David Starner writes:
>>
>>> What has to be done with less? If LESSCHARSET=utf-8, it should handle
>>> utf-8 correct already.
>
> LESSCHARSET is long obsolete and should not be used. Less-358 tests
> LANG/LC_CTYPE/LC_ALL for the UTF-8 substring and activates its UTF-8 mode
> accordingly. Should be changed to nl_langinfo(CODESET) eventually. Robert
> Brady posted here ages ago a patch to fix a less-358 bug with
> bold/underlined non-ASCII characters in UTF-8 mode, which I understand
> both SuSE 7.3 and Red Hat <whatever> have applied in their latest
> versions. Less has not been updated in over a year ...

Robert's patch doesn't work for less-358 patched with the 'ISO' patch
less-358-iso254.patch.bz2 available from

    http://www.io.com/~kazushi/less/

Both SuSE and RedHat apply this 'ISO' patch which makes it impossible
to apply Roberts patch.

But I could fix the problem with a different patch which I posted
to the 'jless' mailing list:

    http://www.egroups.co.jp/message/jless-ja/27

Looks like there is a problem downloading the attachment from that
page, therefore I attach my patch against less-358+iso254 again here:

--- less-358/line.c	Mon Sep 10 17:40:48 2001
+++ less-358/line.c	Tue Sep 11 02:39:58 2001
@@ -586,6 +600,17 @@
 {
 	register char *s;
 	register int a;
+
+	if (utf_mode) {
+		if(0 != ((c) & 0x80)) { 
+			cs = cs | 0x0100; /* mark as non-ascii, i.e. multibyte */
+			if(IS_CONT(c))
+				cs = cs | REST_MASK;
+			else
+				cs = cs | ~REST_MASK;	
+		}
+		
+	}
 
 #define	STOREC(c,cs,a) \
 	if (storec((c),(cs),(a),pos)) return (1); else curr++
When I tried on RedHat Roswell, the bold/underline problem in UTF-8
did still exist. 

-- 
Mike Fabian   <mfabian@xxxxxxx>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。