From owner-freebsd-fs@freebsd.org Mon Dec 23 04:33:37 2019 Return-Path: Delivered-To: freebsd-fs@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 33DD51E408F; Mon, 23 Dec 2019 04:33:37 +0000 (UTC) (envelope-from takawata@sana.init-main.com) Received: from sana.init-main.com (104.194.138.210.bn.2iij.net [210.138.194.104]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "amnesiac", Issuer "amnesiac" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 47h61D5JCQz4CYk; Mon, 23 Dec 2019 04:33:35 +0000 (UTC) (envelope-from takawata@sana.init-main.com) Received: from sana.init-main.com (localhost [127.0.0.1]) by sana.init-main.com (8.15.2/8.15.2) with ESMTPS id xBN4Ihj1010837 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 23 Dec 2019 13:18:54 +0900 (JST) (envelope-from takawata@sana.init-main.com) Received: (from takawata@localhost) by sana.init-main.com (8.15.2/8.15.2/Submit) id xBN4IhBQ010836; Mon, 23 Dec 2019 13:18:43 +0900 (JST) (envelope-from takawata) Date: Mon, 23 Dec 2019 13:18:43 +0900 From: Takanori Watanabe To: Conrad Meyer Cc: freebsd-geom@freebsd.org, freebsd-fs@freebsd.org Subject: Re: svn commit: r356032 - head/usr.sbin/fstyp Message-ID: <20191223041843.GA10764@sana.init-main.com> References: <201912230241.xBN2fDte091985@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201912230241.xBN2fDte091985@repo.freebsd.org> User-Agent: Mutt/1.12.0 (2019-05-25) X-Rspamd-Queue-Id: 47h61D5JCQz4CYk X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.97 / 15.00]; NEURAL_HAM_MEDIUM(-0.97)[-0.968,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Dec 2019 04:33:37 -0000 On Mon, Dec 23, 2019 at 02:41:13AM +0000, Conrad Meyer wrote: > Author: cem > Date: Mon Dec 23 02:41:13 2019 > New Revision: 356032 > URL: https://svnweb.freebsd.org/changeset/base/356032 > > Log: > fstyp(8): Use iconv(3) to convert NTFS vol labels correctly > > Rather than hackily extracting only the ASCII subset of UTF-16LE, go ahead > and convert the label to the user's locale correctly. > Modified: > head/usr.sbin/fstyp/fstyp.c > head/usr.sbin/fstyp/fstyp.h > head/usr.sbin/fstyp/ntfs.c > Good! The code was part of in-kernel glabel(4) code. We may convert the code by iconv(9), but iconv(9) requires userland support and not available on boot time, AFAIK. So I wrote crude ASCII subset convertion. Today, UTF-8 based locale is largely accepted. So in-kernel side of the code may covert fixed UTF-8, assuming devfs encoding as UTF-8.