[CFT] New dialog for ports

Vitaly Magerya vmagerya at gmail.com
Wed Mar 20 12:20:47 UTC 2013


Daniel Nebdal wrote:
> I just found a niggle:
> I have LANG=en_US.UTF-8 , NCURSES_NO_UTF8_ACS=1, TERM=xterm, and I'm
> using putty to connect to a FreeBSD-10 machine running a snapshot from
> february with ports from an hour ago. Putty is set to Translation:
> UTF-8, and "use unicode line drawing code points".
> 
> With those settings, dialog gives me nice line drawing characters (for
> some reason). If I unset NCURSES_NO_UTF8_ACS, all boxes are drawn
> using random letters instead. (jlmqx, to be exact.)

They're not actually random; 'jlmqx' is the ASCII rendering of line
drawing characters in ACS (alternative charset), which putty doesn't
support in UTF-8 mode (therefore it shows the ASCII, not the ASC versions).

> The problem: ports config dialogs are _always_ drawn with the same
> random letters, and I haven't found any setting or combination of
> settings that works.
> 
> This is probably more of a mis-configuration on my side

I'm seeing the same thing too.

I think I've found what causes it: unlike dialog, dialog4ports does not
call setlocale(3) during startup. Try saving the attached patch as
'ports-mgmt/dialog4ports/files/patch-dialog4ports.c' and reinstalling
dialog4ports; report back if it'll help.
-------------- next part --------------
--- dialog4ports.c.orig	2013-03-20 14:07:09.000000000 +0200
+++ dialog4ports.c	2013-03-20 14:07:56.000000000 +0200
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <stringlist.h>
+#include <locale.h>
 
 #include "mixedlist.h"
 
@@ -213,6 +214,7 @@
 	char *helpfile;
 	DIALOG_MIXEDLIST* items;
 
+	setlocale(LC_ALL, "");
 	init_dialog(stdin, stdout);
 	errno = 0;
 


More information about the freebsd-ports mailing list