Re: utf8 patch for mc, slang 2 version



Hi, I've debuged it from the beginning, and:

screen.c 762:


// inserted

			wchar_t lonaka[100];
			memcpy(lonaka,buffer,txtlen*sizeof(wchar_t));
			lonaka[txtlen]=0;

// end inserted

		    printw ("%*s", still, "");

		    printw("%ls",lonaka);
	           //SLsmg_write_nwchars ((wchar_t *) buffer, txtlen);

		    printw ("%*s", len - txtwidth - still, "");


printw("/ls",lonaka); handles everything as expected, the right UTF-8
chars appeared on the screen. So text in the buffer is properly
encoded.
It is an Slang2 issue, but it's too compicated to figure out for the
first blick, the problem in the slsmg.c file.

Does anyone know why #define unix != 1 for darwin-ppc in mc (and/or) slang????


regards,

Bálint


>
> Unices use NFC, while MacOS uses NFD representation of accents (at least for
> filenames, I don't know how about file contents). NFC means each accented
> character has its own "composed" value, that is, one Unicode entity, which
> is usually stored as two (maybe three) bytes in UTF-8. NFD composes the
> characters from two Unicode entities, first the unaccented letter, followed
> by an accent on its own. Its UTF-8 representation hence takes three bytes
> (one for the unaccented letter and two more for the accent).
>
> There are different levels of Unicode specified, I guess supporting NFD
> requires a higher level of conformance since it's a harder job than
> supporting NFC. I bet mc's UTF-8 patch only supports NFC.
>
>
>
> --
> Egmont
>



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