[Remind-Fans] UTF-8 character column width fix

Yomin Nimoy lordyomin at hivegate.net
Tue Oct 21 22:25:07 EDT 2014


Hello David, hello other remind fellows,

first of all thank you for this awesome program.

I'm using remind now for some years primarily by printing the calendar
to stdout. When I first tried to include chinese/japanese characters I
was sad to see that despite UTF-8 support the calendar was malformed.
Obviously characters occupying multiple columns are treated like single
column characters resulting in too much padding or even printing into
the next day's box. Last week I found some time to fix this.

I've mainly incorporated the wcwidth/wcswidth functions to determine
the characters column width by rewriting the PrintLeft, PrintCentered
and PrintOneColLine functions in calendar.c. If this is useful please
use the attached patch (hopefully mailman doesn't filters it) to make
remind even more awesome. If there are some problems with code style or
regressions (I tested multiple corner cases) I'm happy to comply with
changes.

Regards,

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-fix-UTF-8-character-column-width.patch
Type: text/x-patch
Size: 11216 bytes
Desc: not available
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20141022/d9bc2364/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20141022/d9bc2364/attachment.pgp>


More information about the Remind-fans mailing list