wmcbrine / PDCurses

A curses library for environments that don't fit the termcap/terminfo model.
https://pdcurses.org/
1.04k stars 176 forks source link

PDCurses-win10-jp #105

Open Hamayama opened 3 years ago

Hamayama commented 3 years ago

Hello.

On Windows 10, the display corruption of Japanese characters occurs in wincon port. (On Windows 8.1 or earlier, it doesn't occur.)

I made a modified version of PDCurses to fix this issue. https://github.com/Hamayama/PDCurses-win10-jp (Sorry, the document is Japanese only ...)

I'm using this as the front end of Lem editor. https://github.com/cxxxr/lem https://github.com/cxxxr/lem/wiki/Windows-Platform

The whole difference from the mainstream could be seen in the following URL. https://github.com/Hamayama/PDCurses-win10-jp/compare/pdcurses-3.9-orig-618e0aa...master

I wonder this is too complex to merge to the mainstream. (And also, MS is recently recommending VT escape sequence instead of Windows Console API. So, this patch might be useless in few years ...)

So, this is just an information.

Related issues : #87 #92

GitMensch commented 3 years ago

I wonder this is too complex to merge to the mainstream.

Definitely. I think the array check fix should be applied in any case and I suggest to create a new PR for that.

And also, MS is recently recommending VT escape sequence instead of Windows Console API.

In that case I highly suggest to check out the VT port in PDCursesMod and test how well that works for you in general.

Bill-Gray commented 3 years ago

The array check fixes definitely should be applied. It appears to me that you have found three places where array index checks are out of order.

Bill-Gray commented 3 years ago

Actually, a fourth check is in this pull release, to ensure that _new_packet() does not attempt to handle more than 512 characters. I would suggest this fix to break oversized packets into a series of smaller packets. For testing, I tried a MAX_PACKET_SIZE of 4, just to ensure a situation in which lots of packets would be broken. Speed suffered; a 128-character packet size should avoid that problem.

Note that the X11 PDC_transform_line() has a similar issue, amenable to a similar fix. Possibly other platforms as well (my fork has no such limits in WinGUI and the SDLs.) I'll push the X11 fix for my fork after checking other platforms.