From owner-svn-src-stable@freebsd.org Thu Dec 6 09:51:52 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5E951325D57; Thu, 6 Dec 2018 09:51:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C9E089938; Thu, 6 Dec 2018 09:51:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2F2C621D79; Thu, 6 Dec 2018 09:51:52 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wB69pqg7013673; Thu, 6 Dec 2018 09:51:52 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wB69pqLq013672; Thu, 6 Dec 2018 09:51:52 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201812060951.wB69pqLq013672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Thu, 6 Dec 2018 09:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r341626 - stable/12/usr.bin/man X-SVN-Group: stable-12 X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: stable/12/usr.bin/man X-SVN-Commit-Revision: 341626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4C9E089938 X-Spamd-Result: default: False [-0.90 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.48)[-0.477,0]; NEURAL_HAM_SHORT(-0.33)[-0.326,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.10)[-0.099,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2018 09:51:52 -0000 Author: yuripv Date: Thu Dec 6 09:51:51 2018 New Revision: 341626 URL: https://svnweb.freebsd.org/changeset/base/341626 Log: MFC r340128: Teach man(1) about C.UTF-8. While here, use LANG as the proper source to select man pages language/encoding, falling back to LC_CTYPE. Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D17835 Modified: stable/12/usr.bin/man/man.sh Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/man/man.sh ============================================================================== --- stable/12/usr.bin/man/man.sh Thu Dec 6 09:47:23 2018 (r341625) +++ stable/12/usr.bin/man/man.sh Thu Dec 6 09:51:51 2018 (r341626) @@ -662,6 +662,7 @@ man_setup_width() { # Setup necessary locale variables. man_setup_locale() { local lang_cc + local locstr locpaths='.' man_charset='US-ASCII' @@ -670,18 +671,25 @@ man_setup_locale() { if [ -n "$oflag" ]; then decho 'Using non-localized manpages' else - # Use the locale tool to give us the proper LC_CTYPE + # Use the locale tool to give us proper locale information eval $( $LOCALE ) - case "$LC_CTYPE" in + if [ -n "$LANG" ]; then + locstr=$LANG + else + locstr=$LC_CTYPE + fi + + case "$locstr" in C) ;; + C.UTF-8) ;; POSIX) ;; [a-z][a-z]_[A-Z][A-Z]\.*) - lang_cc="${LC_CTYPE%.*}" - man_lang="${LC_CTYPE%_*}" + lang_cc="${locstr%.*}" + man_lang="${locstr%_*}" man_country="${lang_cc#*_}" - man_charset="${LC_CTYPE#*.}" - locpaths="$LC_CTYPE" + man_charset="${locstr#*.}" + locpaths="$locstr" locpaths="$locpaths:$man_lang.$man_charset" if [ "$man_lang" != "en" ]; then locpaths="$locpaths:en.$man_charset"