Hi people,
in line with the current "Add UTF-8 support to everything"-movement, I'd
like to propose the attached patch for the textproc/par port. I use par
to format my email messages (this one included), and I love to use
umlauts, which can be a bit cumbersome with regular par. The patch adds
the UTF-8 patch from [0].
I've tested the patch with the example from [0] and a few emails, both
with and without umlauts, and it seems to work fine.
If it's okay with everyone, I'd also like to take MAINTAINER of the port
since it currently looks orphaned.
[0]:
http://sysmic.org/dotclear/index.php?post/2006/06/22/55-add-multibyte-characters-support-in-par
--
Gregor
Index: Makefile
===
RCS file: /mnt/media/cvs/ports/textproc/par/Makefile,v
retrieving revision 1.20
diff -u -p -r1.20 Makefile
--- Makefile16 Feb 2015 22:57:13 - 1.20
+++ Makefile9 Dec 2015 17:13:46 -
@@ -5,10 +5,12 @@ COMMENT= paragraph reflow for email
VERSION= 1.52
DISTNAME= Par${VERSION:S/.//}
PKGNAME= par-${VERSION}
-REVISION = 0
+REVISION = 1
CATEGORIES=textproc
HOMEPAGE= http://www.nicemice.net/par/
+
+MAINTAINER=Gregor Best
# custom
PERMIT_PACKAGE_CDROM= Yes
Index: patches/patch-utf-8
===
RCS file: patches/patch-utf-8
diff -N patches/patch-utf-8
--- /dev/null 1 Jan 1970 00:00:00 -
+++ patches/patch-utf-8 9 Dec 2015 17:05:09 -
@@ -0,0 +1,1870 @@
+diff -ur ../Par152.orig/buffer.c ./buffer.c
+--- ../Par152.orig/buffer.cFri Mar 9 00:51:11 2001
./buffer.c Wed Dec 9 18:01:22 2015
+@@ -1,9 +1,11 @@
+-/*/
+-/* buffer.c */
+-/* for Par 1.52 */
+-/* Copyright 2001 by */
+-/* Adam M. Costello */
+-/*/
++/***/
++/* buffer.c*/
++/* for Par 1.52-i18n.4 */
++/* Copyright 2001 by */
++/* Adam M. Costello*/
++/* Modified by */
++/* Jérôme Pouiller */
++/***/
+
+ /* This is ANSI C code (C89). */
+
+@@ -18,6 +20,7 @@
+
+ #include
+ #include
++#include
+
+ #undef NULL
+ #define NULL ((void *) 0)
+@@ -60,7 +63,7 @@
+ blk = malloc(sizeof (block));
+ items = malloc(maxhere * itemsize);
+ if (!buf || !blk || !items) {
+-strcpy(errmsg,outofmem);
++wcscpy(errmsg,outofmem);
+ goto nberror;
+ }
+
+@@ -127,7 +130,7 @@
+ new = malloc(sizeof (block));
+ items = malloc(maxhere * itemsize);
+ if (!new || !items) {
+-strcpy(errmsg,outofmem);
++wcscpy(errmsg,outofmem);
+ goto aierror;
+ }
+ blk->next = new;
+@@ -174,7 +177,7 @@
+
+ r = malloc(n * itemsize);
+ if (!r) {
+-strcpy(errmsg,outofmem);
++wcscpy(errmsg,outofmem);
+ return NULL;
+ }
+
+diff -ur ../Par152.orig/buffer.h ./buffer.h
+--- ../Par152.orig/buffer.hFri Mar 9 00:51:25 2001
./buffer.h Wed Dec 9 18:01:22 2015
+@@ -1,9 +1,11 @@
+-/*/
+-/* buffer.h */
+-/* for Par 1.52 */
+-/* Copyright 2001 by */
+-/* Adam M. Costello */
+-/*/
++/***/
++/* buffer.h*/
++/* for Par 1.52-i18n.4 */
++/* Copyright 2001 by */
++/* Adam M. Costello*/
++/* Modified by */
++/* Jérôme Pouiller */
++/***/
+
+ /* This is ANSI C code (C89). */
+
+diff -ur ../Par152.orig/charset.c ./charset.c
+--- ../Par152.orig/charset.c Mon Apr 2 23:51:48 2001
./charset.cWed Dec 9 18:01:22 2015
+@@ -1,9 +1,11 @@
+-/*/
+-/* charset.c */
+-/* for Par 1.52 */
+-/* Copyright 2001 by */
+-/* Adam M. Costello */
+-/*/
++/***/
++/* charset.c */
++/* for Par 1.52-i18n.4 */
++/* Copyright 2001 by */
++/* Adam M. Costello*/
++/* Modified by */
++/* Jérôme Pouiller */
++/***/
+
+ /* This is ANSI C code (C89). */
+
+@@ -18,8 +20,9 @@
+ /* prototypes. Also includes "errmsg.h". */
+ #include "buffer.h" /* Also includes . */
+
+-#include
+ #include
++#include
++#include
+ #include
+ #include
+
+@@ -39,8 +42,8 @@
+ typedef unsigned char csflag_t;
+
+ struct charset {
+- char *inlist;/* Characters in inlist are in the set.*/
+- char *outlist; /* Characters in outlist are not in the set. */
++ wchar_t *inlist;/* Characters in inlist are in the set.
*/
++ wchar_t *outlist; /* Characters in outlist are not in the set.
*/
+/* inlist and outlist must have no common characters. */
+/* inlist and outlist may be NULL, which acts like "". */
+ csflag_t flags; /* Characters in neither list are in the set if they */
+@@ -56,25 +59,25 @@
+ CS_NUL =