>>> chris...@astron.com (Christos Zoulas) wrote

> In article <20180317235857.ga5...@homeworld.netbsd.org>,
>  <m...@netbsd.org> wrote:
> >Hi,
> >
> >I'm not sure what the changes affect. Does this mean UTF-8 won't work
> >either? that's sounds like a big price to pay.
> >Also, the problem doesn't sound specific to mdocml.
> 
> Well, yes it is a bit drastic. Perhaps it can be handled with an
> environment variable instead (to disable for locales that don't work).

I thought about the following change, but it is too ugly.

-- Takeshi Nakayama


--- external/bsd/mdocml/dist/term_ascii.c.orig  2017-03-21 19:13:13.000000000 
+0900
+++ external/bsd/mdocml/dist/term_ascii.c       2018-03-18 15:30:41.000000000 
+0900
@@ -22,6 +22,7 @@
 #include <assert.h>
 #if HAVE_WCHAR
 #include <locale.h>
+#include <string.h>
 #endif
 #include <stdint.h>
 #include <stdio.h>
@@ -99,7 +100,7 @@
                v = TERMENC_LOCALE == enc ?
                    setlocale(LC_CTYPE, "") :
                    setlocale(LC_CTYPE, UTF8_LOCALE);
-               if (NULL != v && MB_CUR_MAX > 1) {
+               if (NULL != v && MB_CUR_MAX > 1 && NULL != strstr(v, ".UTF-8")) 
{
                        p->enc = enc;
                        p->advance = locale_advance;
                        p->endline = locale_endline;

Reply via email to