From owner-freebsd-hackers@freebsd.org Sat Apr 3 06:34:28 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AA0DB5C17D4 for ; Sat, 3 Apr 2021 06:34:28 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC6b83CPxz3HJH for ; Sat, 3 Apr 2021 06:34:28 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: by mailman.nyi.freebsd.org (Postfix) id 6BC5B5C17D3; Sat, 3 Apr 2021 06:34:28 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A3625C1647 for ; Sat, 3 Apr 2021 06:34:28 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from mxt.nsu.ru (mxt.nsu.ru [84.237.50.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC6b80mXgz3HJG; Sat, 3 Apr 2021 06:34:27 +0000 (UTC) (envelope-from danfe@regency.nsu.ru) Received: from zimbra.nsu.ru ([84.237.50.42]) by mxt.nsu.ru with esmtp (Exim 4.89) (envelope-from ) id 1lSZrT-0006zC-3t; Sat, 03 Apr 2021 13:34:23 +0700 Received: from localhost (localhost [127.0.0.1]) by zimbra.nsu.ru (Postfix) with ESMTP id 192D0AC0240; Sat, 3 Apr 2021 13:34:23 +0700 (+07) Received: from zimbra.nsu.ru ([127.0.0.1]) by localhost (zimbra.nsu.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id dn61fqI4rCUF; Sat, 3 Apr 2021 13:34:22 +0700 (+07) Received: from localhost (localhost [127.0.0.1]) by zimbra.nsu.ru (Postfix) with ESMTP id 936CCAC18C6; Sat, 3 Apr 2021 13:34:22 +0700 (+07) X-Virus-Scanned: amavisd-new at zimbra.nsu.ru Received: from zimbra.nsu.ru ([127.0.0.1]) by localhost (zimbra.nsu.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Gv8Vr1HV2Osj; Sat, 3 Apr 2021 13:34:22 +0700 (+07) Received: from regency.nsu.ru (unknown [84.237.50.47]) by zimbra.nsu.ru (Postfix) with ESMTPS id 5DC1DAC0240; Sat, 3 Apr 2021 13:34:22 +0700 (+07) Received: from regency.nsu.ru (localhost [127.0.0.1]) by regency.nsu.ru (8.14.2/8.14.2) with ESMTP id 1336YSPN058210; Sat, 3 Apr 2021 13:34:28 +0700 (+07) (envelope-from danfe@regency.nsu.ru) Received: (from danfe@localhost) by regency.nsu.ru (8.14.2/8.14.2/Submit) id 1336YNnE058142; Sat, 3 Apr 2021 13:34:23 +0700 (+07) (envelope-from danfe) Date: Sat, 3 Apr 2021 13:34:23 +0700 From: Alexey Dokuchaev To: Ed Maste Cc: hackers@freebsd.org Subject: Re: wcwidth() and wcswidth() and Latin vs. CJK character width Message-ID: <20210403063423.GA50619@regency.nsu.ru> References: <20210324143117.GA61738@regency.nsu.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-KLMS-Rule-ID: 1 X-KLMS-Message-Action: clean X-KLMS-AntiSpam-Lua-Profiles: 162882 [Apr 02 2021] X-KLMS-AntiSpam-Version: 5.9.20.0 X-KLMS-AntiSpam-Envelope-From: danfe@regency.nsu.ru X-KLMS-AntiSpam-Rate: 0 X-KLMS-AntiSpam-Status: not_detected X-KLMS-AntiSpam-Method: none X-KLMS-AntiSpam-Auth: dmarc=pass header.from=nsu.ru policy=quarantine; spf=pass smtp.mailfrom=regency.nsu.ru; dkim=none X-KLMS-AntiSpam-Info: LuaCore: 442 442 b985cb57763b61d2a20abb585d5d4cc10c315b09, {rep_avail}, {Tracking_from_domain_doesnt_match_to}, nsu.ru:7.1.1; d41d8cd98f00b204e9800998ecf8427e.com:7.1.1; zimbra.nsu.ru:7.1.1; 127.0.0.199:7.1.2; 84.237.50.42:7.1.2; regency.nsu.ru:7.1.1, {Tracking_smtp_domain_mismatch}, ApMailHostAddress: 84.237.50.42 X-MS-Exchange-Organization-SCL: -1 X-KLMS-AntiSpam-Interceptor-Info: scan successful X-KLMS-AntiPhishing: Clean, bases: 2021/04/03 05:49:00 X-KLMS-AntiVirus: Kaspersky Security for Linux Mail Server, version 8.0.3.30, not scanned, license restriction X-Rspamd-Queue-Id: 4FC6b80mXgz3HJG X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-Mailman-Approved-At: Sat, 03 Apr 2021 07:58:12 +0000 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Apr 2021 06:34:28 -0000 On Fri, Apr 02, 2021 at 04:51:49PM -0400, Ed Maste wrote: > On Wed, 24 Mar 2021 at 10:37, Alexey Dokuchaev via freebsd-hackers > wrote: > > I've been wondering if there's anything like Markus Kuhn's > > implementation* in our base libraries for $subj (my quick naive > > search didn't turn up any results). If yes, could someone point > > me at it? > > Kuhn's implementation is in the kernel for teken > (sys/teken/teken_wcwidth.h). But, wcwidth/wcswidth are available > already in userland, Our default wcwidth(3) does not seem to work as described, but then I've found that Kuhn's code is also part of the libxo(3) which what I should have probably used in the first place. > is there some reason you are looking at Kuhn's implementation > specifically? I want to improve the "ifconfig wlan0 list scan" output, e.g. it currently does not display SSIDs which are in Russian or CJK, but conversion to libxo(3) would address both this problem and make the output easily consumable by external tools. ./danfe