From owner-freebsd-hackers@freebsd.org Tue Jun 19 14:34:07 2018 Return-Path: Delivered-To: freebsd-hackers@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 EFA30101DA8C for ; Tue, 19 Jun 2018 14:34:06 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8D39783FBB for ; Tue, 19 Jun 2018 14:34:06 +0000 (UTC) (envelope-from jhs@berklix.com) Received: by mailman.ysv.freebsd.org (Postfix) id 4C0CA101DA8B; Tue, 19 Jun 2018 14:34:06 +0000 (UTC) Delivered-To: hackers@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 39928101DA8A for ; Tue, 19 Jun 2018 14:34:06 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from land.berklix.org (land.berklix.org [144.76.10.75]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "land.berklix.org", Issuer "land.berklix.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B76C483FBA for ; Tue, 19 Jun 2018 14:34:05 +0000 (UTC) (envelope-from jhs@berklix.com) Received: from mart.js.berklix.net (pD9FA314D.dip0.t-ipconnect.de [217.250.49.77]) (authenticated bits=0) by land.berklix.org (8.15.2/8.15.2) with ESMTPSA id w5JEXvg1006740 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 19 Jun 2018 14:34:03 GMT (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (fire.js.berklix.net [192.168.91.41]) by mart.js.berklix.net (8.14.3/8.14.3) with ESMTP id w5JEXv1L066917 for ; Tue, 19 Jun 2018 16:33:57 +0200 (CEST) (envelope-from jhs@berklix.com) Received: from fire.js.berklix.net (localhost [127.0.0.1]) by fire.js.berklix.net (8.14.7/8.14.7) with ESMTP id w5JEXj2Q057720 for ; Tue, 19 Jun 2018 16:33:57 +0200 (CEST) (envelope-from jhs@berklix.com) Message-Id: <201806191433.w5JEXj2Q057720@fire.js.berklix.net> To: hackers@freebsd.org Subject: Global 25th anniversary of FreeBSD 20th June 2018 From: "Julian H. Stacey" Organization: http://berklix.eu BSD Linux Unix Consultants, Munich Germany User-agent: EXMH on FreeBSD http://www.berklix.eu/free/ X-From: http://www.berklix.eu/~jhs/ Date: Tue, 19 Jun 2018 16:33:45 +0200 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 14:34:07 -0000 Hi hackers@freebsd.org Re http://www.freebsd.org/ > "25th Anniversay FreeBSD" Logo & > "2018-06-19 National FreeBSD Day: FreeBSD is 25 years old today!" http://www.freebsd.org/news/newsflash.html#event20180619:01 https://www.freebsdfoundation.org/national-freebsd-day/ https://www.freebsd.org/news/1993/freebsd-coined.html > Date: Sat, 19 Jun 93 17:26:02 -0700 > From: David Greenman > How about just simply "FreeBSD"? Before global penguins tease us BSD's inumerate, illogical, or too California- centric ;-) ... Sat, 19 Jun 93 17:26:02 -0700 = Sun, 20 Jun 93 00:26:02 +0000 GMT UTC Even then FreeBSD was not a group name, just a personal suggestion 'till it was at least seconded, whenever, from which ever time & zone. So American FreeBSD anniversary might be 19th or after. & Global FreeBSD anniversary is 20th June or after. Cheers, Julian -- Julian Stacey, Computer Consultant, Systems Engineer, BSD Linux Unix, Munich Brexit Referendum stole 3,700,000 votes, inc. 700,000 from British in EU. UK Govt. lied it's "democratic" in Article 50 letter to EU paragraph 3. Petition for votes: http://berklix.eu/queen/ From owner-freebsd-hackers@freebsd.org Tue Jun 19 15:51:31 2018 Return-Path: Delivered-To: freebsd-hackers@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 C9B851022971 for ; Tue, 19 Jun 2018 15:51:31 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6C72487B61 for ; Tue, 19 Jun 2018 15:51:31 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.ysv.freebsd.org (Postfix) id 3036D102296E; Tue, 19 Jun 2018 15:51:31 +0000 (UTC) Delivered-To: hackers@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 1ECFC102296D for ; Tue, 19 Jun 2018 15:51:31 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id AFA2C87B5F for ; Tue, 19 Jun 2018 15:51:30 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 945BD148B3; Tue, 19 Jun 2018 15:51:23 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTPS id w5JFpNwl019072 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Jun 2018 15:51:23 GMT (envelope-from phk@critter.freebsd.dk) Received: (from phk@localhost) by critter.freebsd.dk (8.15.2/8.15.2/Submit) id w5JFpNa2019071; Tue, 19 Jun 2018 15:51:23 GMT (envelope-from phk) To: "Julian H. Stacey" cc: hackers@freebsd.org Subject: Re: Global 25th anniversary of FreeBSD 20th June 2018 In-reply-to: <201806191433.w5JEXj2Q057720@fire.js.berklix.net> From: "Poul-Henning Kamp" References: <201806191433.w5JEXj2Q057720@fire.js.berklix.net> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19069.1529423483.1@critter.freebsd.dk> Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Jun 2018 15:51:23 +0000 Message-ID: <19070.1529423483@critter.freebsd.dk> X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jun 2018 15:51:32 -0000 -------- In message <201806191433.w5JEXj2Q057720@fire.js.berklix.net>, "Julian H. S= tacey" writes: >Before global penguins tease us BSD's inumerate, illogical, or too Califo= rnia- centric ;-) ... > >Sat, 19 Jun 93 17:26:02 -0700 =3D Sun, 20 Jun 93 00:26:02 +0000 GMT UTC What makes you sure the clock and timezone was set correctly on Daves comp= uter ? :-) -- = Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe = Never attribute to malice what can adequately be explained by incompetence= . From owner-freebsd-hackers@freebsd.org Wed Jun 20 00:57:32 2018 Return-Path: Delivered-To: freebsd-hackers@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 08A19101A20C for ; Wed, 20 Jun 2018 00:57:32 +0000 (UTC) (envelope-from grog@lemis.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8563D7EC07 for ; Wed, 20 Jun 2018 00:57:31 +0000 (UTC) (envelope-from grog@lemis.com) Received: by mailman.ysv.freebsd.org (Postfix) id 4610B101A20B; Wed, 20 Jun 2018 00:57:31 +0000 (UTC) Delivered-To: hackers@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 339B6101A20A for ; Wed, 20 Jun 2018 00:57:31 +0000 (UTC) (envelope-from grog@lemis.com) Received: from www.lemis.com (www.lemis.com [208.86.226.86]) by mx1.freebsd.org (Postfix) with ESMTP id C45CD7EC06 for ; Wed, 20 Jun 2018 00:57:30 +0000 (UTC) (envelope-from grog@lemis.com) Received: from eureka.lemis.com (lemis.com [192.109.197.81]) by www.lemis.com (Postfix) with ESMTP id 5F6E81B72837; Wed, 20 Jun 2018 00:57:24 +0000 (UTC) Received: by eureka.lemis.com (Postfix, from userid 1004) id 4043B4494B5; Wed, 20 Jun 2018 10:57:23 +1000 (AEST) Date: Wed, 20 Jun 2018 10:57:23 +1000 From: Greg 'groggy' Lehey To: Poul-Henning Kamp Cc: "Julian H. Stacey" , hackers@freebsd.org Subject: Re: Global 25th anniversary of FreeBSD 20th June 2018 Message-ID: <20180620005723.GE28267@eureka.lemis.com> References: <201806191433.w5JEXj2Q057720@fire.js.berklix.net> <19070.1529423483@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uCPdOCrL+PnN2Vxy" Content-Disposition: inline In-Reply-To: <19070.1529423483@critter.freebsd.dk> Organization: The FreeBSD Project Phone: +61-3-5346-1370, +61-3-5309-0418 Mobile: 0401 265 606. Use only as instructed. WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 00:57:32 -0000 --uCPdOCrL+PnN2Vxy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 19 June 2018 at 15:51:23 +0000, Poul-Henning Kamp wrote: > -------- > In message <201806191433.w5JEXj2Q057720@fire.js.berklix.net>, "Julian H. Stacey" writes: > >> Before global penguins tease us BSD's inumerate, illogical, or too California- centric ;-) ... >> >> Sat, 19 Jun 93 17:26:02 -0700 = Sun, 20 Jun 93 00:26:02 +0000 GMT UTC > > What makes you sure the clock and timezone was set correctly on Daves computer ? :-) Clearly he was using ntp. So does that mean we should update the date in calendar.freebsd? It seems that the real anniversary was 31 minutes ago. Greg -- Sent from my desktop computer. Finger grog@FreeBSD.org for PGP public key. See complete headers for address and phone numbers. This message is digitally signed. If your Microsoft mail program reports problems, please read http://lemis.com/broken-MUA --uCPdOCrL+PnN2Vxy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAlsppnMACgkQIubykFB6QiPlAQCfSn8x1bT+Oiwj65OLMy3ghOqu XqAAoIJA7xtoi9Or8I8a1uo7G/5z3N54 =+4LG -----END PGP SIGNATURE----- --uCPdOCrL+PnN2Vxy-- From owner-freebsd-hackers@freebsd.org Wed Jun 20 01:34:31 2018 Return-Path: Delivered-To: freebsd-hackers@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 546CD101C5BA for ; Wed, 20 Jun 2018 01:34:31 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC2938031F for ; Wed, 20 Jun 2018 01:34:30 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-it0-x236.google.com with SMTP id u4-v6so3228299itg.0 for ; Tue, 19 Jun 2018 18:34:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=BCeGtnxJII3mvGep4FfWjqejhbDJlkLUA2wwYBZh6nk=; b=E2mNK0iGBeQK0A1tlpeROCJRQr23T+sL3K0JZVegz5L9k1oUww8H7pdP6jD31KXaog ZaL+4VNQm0Z3vPWQlr+zaaw0loplmyb5Ta3sLLguBoj2qS+jsJhR20FoGqjV5/D4D0dX xYjkJswxxtf/FIjLXGSQLt0aKAruDBUgrfa/yVDe+l2rGP+7KmZoNLobJgjIl/Iwyj7R 3xpCE/LOoCq5P7qkgoYfQrqRcHny/bPImtxY4eQ4DECO9aBT9+A6kMgAjG8aNOrFAIUn YeEzFYgANcz7z/Ox6DdeTkWKm4fD6yxGKcA54B+ORc7B0AwHYa3myBsMlb0bUJxB0F5X 3rig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=BCeGtnxJII3mvGep4FfWjqejhbDJlkLUA2wwYBZh6nk=; b=E3NBUJ/F8zVWkkVqya34pWVYc32dX1SzdypTTKkUKJ8C0kXOZmCBMFW7Yfdq+7CUbs 0Ko2q7oESJfKr6EHoewuJL8vvZcPfDJh9Mbem1L52LiFoBbpJqUiWPokPvVusxi+6VMo Q3uToAgob9eZqDjLYwIRnZ9+FdazQa0c8XBYIJQ0EgihDU9s0i0H2tfDY72q415i16h9 fTODyDj7XDM9O+UkTaawDGAggCkpcaTderA4KY9HuVDhHb1jneoq6MP8wuHInQJrNOHg Q58YWywfOPMNJx1AkYlH5ojVbKqgIvz0NYQYx0cc/h1zBvBU/r42IyCllZr28a6xfi7G Uv0A== X-Gm-Message-State: APt69E3NwHCDr0Gfrn9R4X30OIXOicHy26YK3hvNfx9jb6DcAyZAD1iY UPB5cpfT9SpvQCi8UIVuV/7G2LcNx6i5FgujBiOcuygW X-Google-Smtp-Source: ADUXVKIhIDHzeDjKWvUiTh1aZY3S9qgsI3RNDknCLj3lIPcBhR49d+3M7PtcnhpHqi4p0otRoGUUg4TbnfCqtQH1DW0= X-Received: by 2002:a24:e51a:: with SMTP id g26-v6mr31998iti.43.1529458469972; Tue, 19 Jun 2018 18:34:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:a148:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 18:34:09 -0700 (PDT) In-Reply-To: <20180202035130.C51F8156E80B@mail.bitblocks.com> References: <20180201072831.GA2239@c720-r314251> <20180202035130.C51F8156E80B@mail.bitblocks.com> From: Farhan Khan Date: Tue, 19 Jun 2018 21:34:09 -0400 Message-ID: Subject: Re: Printing UTF-8 characters To: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 01:34:31 -0000 On Thu, Feb 1, 2018 at 10:51 PM, Bakul Shah wrote: > On Thu, 01 Feb 2018 10:42:36 -0500 Farhan Khan wrote: >> Sorry, that was a poorly phrased question on my part. Let me try again. >> I am trying to make text align in columns in a terminal. My >> understanding is that characters above 0x7E are 3 bytes in length. A >> modern terminal will render that as either a single question-mark or >> the character itself, making terminal column alignment easy. But how >> would an older terminal display a 3-byte character? I am worried that >> would render as 3 question marks and throw off column alignment. If >> so, is there a proper way to perform alignment for both newer and >> older terminals? > > UTF-8 can use upto 4 bytes to encode a unicode point, > depending on the script. > > For what you want, you can use openoffice like programs that > understand unicode and can do complex text layout. Normal > terminal programs typically use monospace (fixed width) fonts > are simply not capable of what you want. The assumption that > one char means one rectangular cell on the screen is too > deeply woven in them. Particularly for Indic languages this > just doesn't work, You may have N unicode points, each of > which require 3 bytes, all together map to a one single glyph. Hi all, To follow-up from my earlier poorly asked question from a few months back, how do I determine if the terminal is capable of printing UTF-8 encoded strings and/or unicode in general? The obvious answer is to check the LANG variable via getenv(3), but what if you are using "en_US.UTF-8" vs "en_GB.UTF-8"? Should I just check for the string "UTF-8" in the LANG variable? My concern is printing characters above 0x7F on terminals/encodings that are not capable of displaying them, resulting in unusual behavior. Thanks, -- Farhan Khan PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE From owner-freebsd-hackers@freebsd.org Wed Jun 20 02:46:36 2018 Return-Path: Delivered-To: freebsd-hackers@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 D7852101FCED for ; Wed, 20 Jun 2018 02:46:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com [209.85.214.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 767D882328 for ; Wed, 20 Jun 2018 02:46:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f42.google.com with SMTP id 16-v6so3359954itl.5 for ; Tue, 19 Jun 2018 19:46:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=f5gQIXiFTwYrNITA06x1cwUhCzmijF4al+l1KekEZkA=; b=FedPJ45tXxrH4JEyHKUxJcfc2vlbD9SqbQ8wLldwlwWCCTyrAFHTVtGE9vRjv/DieE mY+dWAbToanFBYAAVRZUMIui7NHIb7z7tM6wo1h50Bc8wi7z1x9UyXd/Nni4ariImhlV e5zM2aTiFTWgKiGmBfhNu39TMn7QC6k4Nw2/nm3CAd72wzxyltwn8fRyhcN0VPBeBJmV Z/AiHc7ABE6USyN1We8s6B//NvjUE4n+7Q+p9LHHwevXRq7aStOWhyVkRD1YOm3yPRIi LkP0XLHBCDxyujw7d4TspUQRdwKRd7/5X1APWVzNgUciexnbfcWbzQyqCpEyP+rA3TI/ 8p1A== X-Gm-Message-State: APt69E2EqFEUYs5+PK13Z+SdX9yIB0uGuW/sjtZMe8CNfR4hAbsMs3J3 gNOqNN5N6O0piaQv5d0t4PZkGxqy X-Google-Smtp-Source: ADUXVKJbh+3vv2stCU+BnrAntnuBb33wmwsq0YWNzDhyndhmzH7GjWFWhWpsf2ljhFqfGJS3Sy0AjA== X-Received: by 2002:a02:93:: with SMTP id 141-v6mr16000544jaa.4.1529462789388; Tue, 19 Jun 2018 19:46:29 -0700 (PDT) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id a200-v6sm618511ioa.56.2018.06.19.19.46.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 19:46:29 -0700 (PDT) Received: by mail-it0-f42.google.com with SMTP id l6-v6so3443017iti.2 for ; Tue, 19 Jun 2018 19:46:29 -0700 (PDT) X-Received: by 2002:a24:100f:: with SMTP id 15-v6mr161690ity.61.1529462788930; Tue, 19 Jun 2018 19:46:28 -0700 (PDT) MIME-Version: 1.0 References: <20180201072831.GA2239@c720-r314251> <20180202035130.C51F8156E80B@mail.bitblocks.com> In-Reply-To: Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 19 Jun 2018 19:46:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Printing UTF-8 characters To: Farhan Khan Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 02:46:36 -0000 You want LC_CTYPE. On Tue, Jun 19, 2018 at 6:38 PM Farhan Khan wrote: > On Thu, Feb 1, 2018 at 10:51 PM, Bakul Shah wrote: > > On Thu, 01 Feb 2018 10:42:36 -0500 Farhan Khan wrote: > >> Sorry, that was a poorly phrased question on my part. Let me try again. > >> I am trying to make text align in columns in a terminal. My > >> understanding is that characters above 0x7E are 3 bytes in length. A > >> modern terminal will render that as either a single question-mark or > >> the character itself, making terminal column alignment easy. But how > >> would an older terminal display a 3-byte character? I am worried that > >> would render as 3 question marks and throw off column alignment. If > >> so, is there a proper way to perform alignment for both newer and > >> older terminals? > > > > UTF-8 can use upto 4 bytes to encode a unicode point, > > depending on the script. > > > > For what you want, you can use openoffice like programs that > > understand unicode and can do complex text layout. Normal > > terminal programs typically use monospace (fixed width) fonts > > are simply not capable of what you want. The assumption that > > one char means one rectangular cell on the screen is too > > deeply woven in them. Particularly for Indic languages this > > just doesn't work, You may have N unicode points, each of > > which require 3 bytes, all together map to a one single glyph. > > Hi all, > > To follow-up from my earlier poorly asked question from a few months > back, how do I determine if the terminal is capable of printing UTF-8 > encoded strings and/or unicode in general? > The obvious answer is to check the LANG variable via getenv(3), but > what if you are using "en_US.UTF-8" vs "en_GB.UTF-8"? Should I just > check for the string "UTF-8" in the LANG variable? > > My concern is printing characters above 0x7F on terminals/encodings > that are not capable of displaying them, resulting in unusual > behavior. > > Thanks, > > -- > Farhan Khan > PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > From owner-freebsd-hackers@freebsd.org Wed Jun 20 04:21:19 2018 Return-Path: Delivered-To: freebsd-hackers@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 59CB71024220 for ; Wed, 20 Jun 2018 04:21:19 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDE4E8603D; Wed, 20 Jun 2018 04:21:18 +0000 (UTC) (envelope-from khanzf@gmail.com) Received: by mail-it0-x232.google.com with SMTP id v83-v6so3656744itc.3; Tue, 19 Jun 2018 21:21:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NYlI8P3OG3TlUW0O3TjtoFFPb7OEHkv5+tDXLBb7TKw=; b=tfqAB0kOJbTRkIxJU3vTDsHptbzUSHR4DPbgk4blS5Qgji7ZzmJcINksI8Lo5NYxJH N2G0qbvAoGHZosKWn5j7g2b1JWBpwxc3uKRTh8o6CH3jPAfK2bftLf1B3YB0qLK/bakb 2B6fDWvcUy8DfOjaykb4dN8MX/egt2PsNsU3fsWLaSYWbVPyzWHxXvCcIk4UvsyNhLQi XEni/UrgSh9yvleB/s6Ozz8/8M8XqOwzNXCq1RYqWFIyizTizKO/TQoUHtzY4Gv3rVF5 JYlaHDZkFxLGCWbi2dIdYJrIfaFGr+1lNkGQAQHQVcm7nzeip+qoUBRKvrcu+Rq81Ws/ Hg1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=NYlI8P3OG3TlUW0O3TjtoFFPb7OEHkv5+tDXLBb7TKw=; b=TaLj645gcjPQLtpzgnLzwDBsaoNfCtGCdipp3GZiwbtTscgZJvZ2XAxoIMUmWcku4h gBCZ/dBITHVEF0hkodQZJsixTKL2WVhyPfxtH3MGYKgcs3trxmdz56kn08t9QMH0dNzx VP2leidlEIwduWsQmOGVJglImcMEue8vdAQ/SqXCJKcl143oFgKUPxO7f4WkD8uAsFkY QaSb4mtLPU/EeLkTD+gUqDCKKqeME2hMN9EwaTpeFTx0x8Zc+dCQhNs2jE+HS0DvbK0e 7LIVMjTOW/lMEGX2ukacP2yl3ZushT3wptYbr47YUie7sLKe9Edh2vm8LyyzVSct/kwa Goqg== X-Gm-Message-State: APt69E1I5tOCb0HMI0DQNUvxpSwXPWGYpXmlm7lzRao/x2JFuQ7IfTDR Uy2phuhlwcIAiTL0BE0fMifhpAHJWQJuNYh1cOYOKQ== X-Google-Smtp-Source: ADUXVKJTHZE/P9h6NlpeUwHeeNoAcFXDxJU3BohUY66Gj6bJW3h7AqdCX4XU0OPUxH49SPY/fzUuKWGY0U4WyO0j8FQ= X-Received: by 2002:a24:e51a:: with SMTP id g26-v6mr312089iti.43.1529468478026; Tue, 19 Jun 2018 21:21:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:a148:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 21:20:57 -0700 (PDT) In-Reply-To: References: <20180201072831.GA2239@c720-r314251> <20180202035130.C51F8156E80B@mail.bitblocks.com> From: Farhan Khan Date: Wed, 20 Jun 2018 00:20:57 -0400 Message-ID: Subject: Re: Printing UTF-8 characters To: cem@freebsd.org Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2018 04:21:19 -0000 On Tue, Jun 19, 2018, 10:46 PM Conrad Meyer wrote: > You want LC_CTYPE. > > On Tue, Jun 19, 2018 at 6:38 PM Farhan Khan wrote: > >> On Thu, Feb 1, 2018 at 10:51 PM, Bakul Shah wrote: >> > On Thu, 01 Feb 2018 10:42:36 -0500 Farhan Khan >> wrote: >> >> Sorry, that was a poorly phrased question on my part. Let me try again. >> >> I am trying to make text align in columns in a terminal. My >> >> understanding is that characters above 0x7E are 3 bytes in length. A >> >> modern terminal will render that as either a single question-mark or >> >> the character itself, making terminal column alignment easy. But how >> >> would an older terminal display a 3-byte character? I am worried that >> >> would render as 3 question marks and throw off column alignment. If >> >> so, is there a proper way to perform alignment for both newer and >> >> older terminals? >> > >> > UTF-8 can use upto 4 bytes to encode a unicode point, >> > depending on the script. >> > >> > For what you want, you can use openoffice like programs that >> > understand unicode and can do complex text layout. Normal >> > terminal programs typically use monospace (fixed width) fonts >> > are simply not capable of what you want. The assumption that >> > one char means one rectangular cell on the screen is too >> > deeply woven in them. Particularly for Indic languages this >> > just doesn't work, You may have N unicode points, each of >> > which require 3 bytes, all together map to a one single glyph. >> >> Hi all, >> >> To follow-up from my earlier poorly asked question from a few months >> back, how do I determine if the terminal is capable of printing UTF-8 >> encoded strings and/or unicode in general? >> The obvious answer is to check the LANG variable via getenv(3), but >> what if you are using "en_US.UTF-8" vs "en_GB.UTF-8"? Should I just >> check for the string "UTF-8" in the LANG variable? >> >> My concern is printing characters above 0x7F on terminals/encodings >> that are not capable of displaying them, resulting in unusual >> behavior. >> >> Thanks, >> >> -- >> Farhan Khan >> PGP Fingerprint: B28D 2726 E2BC A97E 3854 5ABE 9A9F 00BC D525 16EE >> _______________________________________________ >> freebsd-hackers@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers >> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org >> " >> > Thanks Conrad! I looked up exactly how locale(1) worked. Similar to what you suggested, locale(1) did essentially this: setlocale(LC_ALL, ""); charset = nl_langinfo(CODESET); The final product was 'charset'. Thanks! >