From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.2817.1631158099367430728 for ; Wed, 08 Sep 2021 20:28:19 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=rR9OTHwW; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: zhichao.gao@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10101"; a="220695314" X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="220695314" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2021 20:28:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,279,1624345200"; d="scan'208";a="466176256" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga007.fm.intel.com with ESMTP; 08 Sep 2021 20:28:14 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Wed, 8 Sep 2021 20:28:14 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Wed, 8 Sep 2021 20:28:14 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.176) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Wed, 8 Sep 2021 20:28:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DkyWOa6+sogXgUVW4NsKCTvErHsPGgClryfrzUpQsJBiVpdwnsTfbaTrsHim5R1lLVtBQ7fZuQgq/N3oTAicxtXgt5RTJyR2gubB9R/EB05b6kl8x3sh69ms+PFU01UukJ9bWYFmlCM9lnjfA5XXSC+v+cRL1gTx1rt4hpmKHh/zFFBZWeevR2/KNWyBKOx/cVf5LQOik4Ot8ZJqYZTgmwUnmVT91yPDuqU+4V2yarrigGAX/J1POwILhKqzgRyOOtL8gUNiQYmLsD5oI3EyD0lFSc+1enGw0/uAt759dmy6FaXaO7bPuSqd27rvU2qI6T3J0tUsWgXEeqm2HRXUTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8/G9jxz0yZ1cjgiUkon5LhwPI0C0wAFzIcT8Zs8VqCM=; b=eZSA0CjMx7hlZXjh1ZJlm01WougItJhJv/ttgr87U5JfgesSXKenBnI9LMsTLazWC1fuTpBg55utDoppZTge4SI+tPgYHQf91XBkjpHs8B/kWHE/aQvMpoiSugL8dfV0UFl1mrrC+mT3n0j6Krj36W3wiaWJg37RaigyKAMVjTfVqRh3n/MzzoJR7QhYNI3ybVYyCff57qH1ZGZQNgo4iNt0sF0EPRrOvc/Hey0Tx2itFvDKEaKFVt9Q8i9CR88IlmrrtH8Hehy8MiEldqFc9ySFGyG4T6bcFdT91bqkeTotaOevt7KoZzzM8MBv9l2FTC/8YosHGSwPfZ9HX+1Alw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8/G9jxz0yZ1cjgiUkon5LhwPI0C0wAFzIcT8Zs8VqCM=; b=rR9OTHwWXDtCbIu+QWsrZCPX6xS0z4h3JRHjldpBbBVBt8MFjlTHa0BJHMTlgIXtsy0HSEuIpa1h5vfBUK6Lam5axVFgj2zNnRFvHX7E7TGh1PYmoePrgyuIQuJOqxAG9UO8MVb21O1IYhmxHhisUdNU+lHI2qjq+7eFbf1Pne8= Received: from BN9PR11MB5275.namprd11.prod.outlook.com (2603:10b6:408:134::24) by BN9PR11MB5227.namprd11.prod.outlook.com (2603:10b6:408:134::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4500.14; Thu, 9 Sep 2021 03:28:12 +0000 Received: from BN9PR11MB5275.namprd11.prod.outlook.com ([fe80::e881:d013:b8f9:35cb]) by BN9PR11MB5275.namprd11.prod.outlook.com ([fe80::e881:d013:b8f9:35cb%6]) with mapi id 15.20.4500.016; Thu, 9 Sep 2021 03:28:12 +0000 From: "Gao, Zhichao" To: Caden Kline , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Wu, Hao A" , "Ni, Ray" , "Desimone, Nathaniel L" Subject: Re: [PATCH v3 1/1] MdeModulePkg/Console: Improve encoding of box drawing characters Thread-Topic: [PATCH v3 1/1] MdeModulePkg/Console: Improve encoding of box drawing characters Thread-Index: AQHXl8jOgPh9sG4u/06LIh4qcBFsLKubIWIw Date: Thu, 9 Sep 2021 03:28:12 +0000 Message-ID: References: <20210823024416.377856-1-cadenkline9@gmail.com> <20210823024416.377856-2-cadenkline9@gmail.com> In-Reply-To: <20210823024416.377856-2-cadenkline9@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d3a93182-e819-44ce-20a4-08d97341da7e x-ms-traffictypediagnostic: BN9PR11MB5227: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3173; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: x8rmNYnmJVqZnUH1h46k5tqgSjpv9kV6TTfdhuaAPZqjd2tanOFL2BR3RH64J/ReembBVXzUXQ1jdQki3SJ1Zuaxu5ZXCcPfNlSjCpjcQrRPkUrY65DhE4/NRTJUPQO9MBIgPZMle8A0PW2PWfsakvWL79q9RLNlZviL/petRD+C4ccagw7P+DBeZ0wXniucCHlEoWSmsD+sL/PlgBg35oLTn4McHGb8EUYVOx4BlhuDcI2a3/qscwvr0ckIvi1V+Oa3yu56cOQ+cmIDlTOfBt3P7tfhLSgvBFpYjuTGArfqpldZdnke5WZ14ZRnyaw9xA49OkFFkqAcAo4xjPzzUpRjszXrJAwpI7cVqx2MyF9Pr6szjQx8FW0gcz2NT0PzppIDz5lizr5SkIVjnTv32Hzpj7+lNIGdGlMOC/dHUuTqLxu66fitQw3dOcxsJ2nxyuEkNKhmJJt2c7cEQKL+3JH/lu2QAfP491t8MLNhRncpeFOBrIRTEPlbUGWKwhb2U9A1a/aurMx55baQKCzCpSHrQGvg+0YbJTnbhG5NOQdRwvI09PnsFwLzY7VtjhsWU/URojvmZS4ak7laR4dxX20F9XSStoMyWnPNPZKon8LMW7Yjtcojh00wdoEnrYlhkY9b24oFvuXE6Tj4UHp6BWd+wVhSovn3mr6VK2MFD7W/243dWdET6gKGH4LFb81J6Crm+rhmmlKOpammehww6FJ4GLKBuW81EoMm0ZIb58X5lVTo/pG1tmQ4HFqte9SqZMNgy7SGHAcdHX2EaABUbB/SfHRTnhiPDDh7jyJu0dI= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN9PR11MB5275.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(396003)(346002)(376002)(39860400002)(86362001)(76116006)(7696005)(107886003)(83380400001)(316002)(2906002)(52536014)(966005)(38100700002)(8936002)(71200400001)(53546011)(4326008)(122000001)(54906003)(110136005)(33656002)(38070700005)(30864003)(8676002)(6506007)(66946007)(66556008)(55016002)(64756008)(66446008)(478600001)(66476007)(186003)(26005)(5660300002)(9686003)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3EzYWbgGYlZ1pahwjVIqCgBePl+BA1b1bAgqIkiPAWHfn2X7gFHaK+G47OKb?= =?us-ascii?Q?TkHOI/0Zm0ZhyK4RbID1mxgv72EU2UH8MWslToTzDmsuYKBRWMExOAfob34t?= =?us-ascii?Q?7xRDURSuM+pQQPnY9mJlArnJf1l7ojVptrYyPMFQtbSdCj6oj/qjcJ0YenJX?= =?us-ascii?Q?i6VfUiaaUgFUZsiI/enFubd/xW0Z7BIEAPNYZNv7UyABsWclhLAoYsT3Cre+?= =?us-ascii?Q?21O6uwe3fi34vxPembK6ejD6ZUJIiol7dJreriG4sXC4OoPAXPHUGJJR5zFZ?= =?us-ascii?Q?zuImEaDHqha/WM3/VTKyqqv2K4HK/tcUGyk5bGP1MEbfVHwRFxy4Q18p3hB5?= =?us-ascii?Q?9QFZFyKiHaIaeJT8wdKnUdLdMSGYERoFpVwJ9yYZwYz1pON77AAoqH4NH9rD?= =?us-ascii?Q?0P5ptQTyzbRUdXrH/Lu2n6fZJpB9NZXzgDSla+j3EOU4OsHIA9nJnt0dblrz?= =?us-ascii?Q?PKLEoTQXpaX2A/vM55PLPd74AqXpcZIAZWV0OWQvVeekWN8V6+mC0dEeb1uc?= =?us-ascii?Q?5TxHUksqwDz0Zd0muFDwOvtyYd3eUB436oP4wDZrpF/QiG05ox+UTXOqBWVF?= =?us-ascii?Q?Op4gnIeH7a+RAlI0Qazfk8S97RWKkCrM3gaYPyD9wSUmpM4C9MMXUUrtyBy3?= =?us-ascii?Q?BIScvV2QeOXd3xRS25mtohrRXVVUQfOiGx/K++dBqD0+nb0RxoyRaHqrEuJ7?= =?us-ascii?Q?yhl2pqbm8nILxKlODui93JhpiNjoyzzqlutCSbke1dFHFalH9RHFsSenjdsy?= =?us-ascii?Q?Xx4PmegtJSTIBd5LGvB0b5doYkeUpTBDXr/DT66yNg8XNvJ+A6SJM4SMAquH?= =?us-ascii?Q?35YZDdxQDJ3lIzxUghZGrC2LYsq2sicw1cikXD4SFKq1HrPO4lxvlLB3M0Eu?= =?us-ascii?Q?ch3/FVIJ5ym+62OLsBOZ8Li32xR1G+v7sXM5jpTzQAoA2QmbLveW7zcvrTBm?= =?us-ascii?Q?AYlit2zJGoca3ck1FzPVD3lqm/Z5DGifLx4LZnGrJ2wwPpu2vpQhbScnTNfd?= =?us-ascii?Q?9HBfMTggF4IB0gH/KAvvSJomfsuDthqDrDZk8i4wAqXVO3sMOObeBig49mSY?= =?us-ascii?Q?Kyk0S+8f3KeEoBJHIoQn8M7vYyCizKtazTxr9laguTUFyQG8YCWD18VSKXdZ?= =?us-ascii?Q?M6gIgclTox5pSvTmDSK9lw9FUFY5bYqIlnML+tRFY8GvrzH5UI1mF79QKBlh?= =?us-ascii?Q?7gCmhrr9sQL2vnCyV8vIXGjq5dBFnf547nsMwtOqVTXnbvojOWvoOr82cYVy?= =?us-ascii?Q?ga3oI2bMiC3A0tuCv+HQODLDtRXvP0zwJnZ2gK/YVZNpkg2PYEBpuOAvb+hu?= =?us-ascii?Q?arWd0trrkOIuT90spESL+Pbl?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5275.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3a93182-e819-44ce-20a4-08d97341da7e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Sep 2021 03:28:12.3959 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: OXXP2S/ZXz2sgBYBUXOGYiyL5XcAXD2t+bkczwkmlEwxTr1kezjqXaw1H6hRPmptmdAjBW/pVt3kcT+o8nPqPA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5227 Return-Path: zhichao.gao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Caden, The patch doesn't address all the comment I point out. If you think I am in= correct, please feel free to point out. See below: > -----Original Message----- > From: Caden Kline > Sent: Monday, August 23, 2021 10:44 AM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Wu, Hao A ; > Gao, Zhichao ; Ni, Ray ; > Desimone, Nathaniel L > Subject: [PATCH v3 1/1] MdeModulePkg/Console: Improve encoding of box > drawing characters >=20 > Improved encoding of box drawing characters for different terminal types. > This includes Dec special graphics mode and more utf8. > Changes are made according to the below issue >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D3580 >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Zhichao Gao > Cc: Ray Ni > Signed-off-by: Caden Kline > Reviewed-by: Nate DeSimone > --- > MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h | 26 +- > MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c | 2 +- > MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c | 295 > +++++++++++++++----- > 3 files changed, 243 insertions(+), 80 deletions(-) >=20 > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h > b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h > index 360e58e84743..1eab439531dc 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Terminal.h > @@ -122,7 +122,12 @@ typedef struct { > EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL SimpleInputEx; >=20 > LIST_ENTRY NotifyList; >=20 > EFI_EVENT KeyNotifyProcessEvent; >=20 > + BOOLEAN DecSpecialGraphicsMode; >=20 > } TERMINAL_DEV; >=20 > +// >=20 > +// This the length the escape sequences for entering and exiting Dec Spe= cial > Graphics Mode >=20 > +// >=20 > +#define LENGTH_DEC_ESCAPE 0x03 >=20 >=20 >=20 > #define INPUT_STATE_DEFAULT 0x00 >=20 > #define INPUT_STATE_ESC 0x01 >=20 > @@ -169,6 +174,7 @@ typedef struct { > UINT16 Unicode; >=20 > CHAR8 PcAnsi; >=20 > CHAR8 Ascii; >=20 > + CHAR8 DecSpecialGraphics; >=20 > } UNICODE_TO_CHAR; >=20 >=20 >=20 > // >=20 > @@ -1367,20 +1373,22 @@ Utf8ToUnicode ( > /** >=20 > Detects if a Unicode char is for Box Drawing text graphics. >=20 >=20 >=20 > - @param Graphic Unicode char to test. >=20 > - @param PcAnsi Optional pointer to return PCANSI equivalent of >=20 > - Graphic. >=20 > - @param Ascii Optional pointer to return ASCII equivalent of >=20 > - Graphic. >=20 > - >=20 > - @retval TRUE If Graphic is a supported Unicode Box Drawing cha= racter. >=20 > + @param Graphic Unicode char to test. >=20 > + @param PcAnsi Optional pointer to return PCANSI equivale= nt of >=20 > + Graphic. >=20 > + @param Ascii Optional pointer to return ASCII equivalen= t of >=20 > + Graphic. >=20 > + @param DecSpecialGraphics Optional pointer to return Dec Special > Graphics equivalent of >=20 > + Graphic. >=20 > + @retval TRUE If Graphic is a supported Unicode Box Draw= ing > character. >=20 >=20 >=20 > **/ >=20 > BOOLEAN >=20 > TerminalIsValidTextGraphics ( >=20 > IN CHAR16 Graphic, >=20 > - OUT CHAR8 *PcAnsi, OPTIONAL >=20 > - OUT CHAR8 *Ascii OPTIONAL >=20 > + OUT CHAR8 *PcAnsi, OPTIONAL >=20 > + OUT CHAR8 *Ascii, OPTIONAL >=20 > + OUT CHAR8 *DecSpecialGraphics OPTIONAL >=20 > ); >=20 >=20 >=20 > /** >=20 > diff --git a/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c > b/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c > index f117d90b9de3..5ae5a4f0212e 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/Ansi.c > @@ -63,7 +63,7 @@ AnsiTestString ( >=20 >=20 > if ( !(TerminalIsValidAscii (*WString) || >=20 > TerminalIsValidEfiCntlChar (*WString) || >=20 > - TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL) )) { >=20 > + TerminalIsValidTextGraphics (*WString, &GraphicChar, NULL, NULL)= )) { >=20 >=20 >=20 > return EFI_UNSUPPORTED; >=20 > } >=20 > diff --git > a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c > b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c > index aae470e9562c..7b328162325e 100644 > --- a/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c > +++ b/MdeModulePkg/Universal/Console/TerminalDxe/TerminalConOut.c > @@ -16,61 +16,59 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > // >=20 > // >=20 > UNICODE_TO_CHAR UnicodeToPcAnsiOrAscii[] =3D { >=20 > - { BOXDRAW_HORIZONTAL, 0xc4, L'-' }, >=20 > - { BOXDRAW_VERTICAL, 0xb3, L'|' }, >=20 > - { BOXDRAW_DOWN_RIGHT, 0xda, L'/' }, >=20 > - { BOXDRAW_DOWN_LEFT, 0xbf, L'\\' }, >=20 > - { BOXDRAW_UP_RIGHT, 0xc0, L'\\' }, >=20 > - { BOXDRAW_UP_LEFT, 0xd9, L'/' }, >=20 > - { BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|' }, >=20 > - { BOXDRAW_VERTICAL_LEFT, 0xb4, L'|' }, >=20 > - { BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+' }, >=20 > - { BOXDRAW_UP_HORIZONTAL, 0xc1, L'+' }, >=20 > - { BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+' }, >=20 > - { BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-' }, >=20 > - { BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|' }, >=20 > - { BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/' }, >=20 > - { BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/' }, >=20 > - { BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/' }, >=20 > - { BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\' }, >=20 > - { BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\' }, >=20 > - { BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\' }, >=20 > - { BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\' }, >=20 > - { BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\' }, >=20 > - { BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\' }, >=20 > - { BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/' }, >=20 > - { BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/' }, >=20 > - { BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/' }, >=20 > - { BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|' }, >=20 > - { BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|' }, >=20 > - { BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|' }, >=20 > - { BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|' }, >=20 > - { BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|' }, >=20 > - { BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|' }, >=20 > - { BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+' }, >=20 > - { BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+' }, >=20 > - { BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+' }, >=20 > - { BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+' }, >=20 > - { BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+' }, >=20 > - { BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+' }, >=20 > - { BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+' }, >=20 > - { BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+' }, >=20 > - { BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+' }, >=20 > + { BOXDRAW_HORIZONTAL, 0xc4, L'-', 0x71 }, >=20 > + { BOXDRAW_VERTICAL, 0xb3, L'|', 0x78 }, >=20 > + { BOXDRAW_DOWN_RIGHT, 0xda, L'/', 0x6c }, >=20 > + { BOXDRAW_DOWN_LEFT, 0xbf, L'\\', 0x6b }, >=20 > + { BOXDRAW_UP_RIGHT, 0xc0, L'\\', 0x6d }, >=20 > + { BOXDRAW_UP_LEFT, 0xd9, L'/', 0x6a }, >=20 > + { BOXDRAW_VERTICAL_RIGHT, 0xc3, L'|', 0x74 }, >=20 > + { BOXDRAW_VERTICAL_LEFT, 0xb4, L'|', 0x75 }, >=20 > + { BOXDRAW_DOWN_HORIZONTAL, 0xc2, L'+', 0x77 }, >=20 > + { BOXDRAW_UP_HORIZONTAL, 0xc1, L'+', 0x76 }, >=20 > + { BOXDRAW_VERTICAL_HORIZONTAL, 0xc5, L'+', 0x6e }, >=20 > + { BOXDRAW_DOUBLE_HORIZONTAL, 0xcd, L'-', 0x71 }, >=20 > + { BOXDRAW_DOUBLE_VERTICAL, 0xba, L'|', 0x78 }, >=20 > + { BOXDRAW_DOWN_RIGHT_DOUBLE, 0xd5, L'/', 0x6c }, >=20 > + { BOXDRAW_DOWN_DOUBLE_RIGHT, 0xd6, L'/', 0x6c }, >=20 > + { BOXDRAW_DOUBLE_DOWN_RIGHT, 0xc9, L'/', 0x6c }, >=20 > + { BOXDRAW_DOWN_LEFT_DOUBLE, 0xb8, L'\\', 0x6b }, >=20 > + { BOXDRAW_DOWN_DOUBLE_LEFT, 0xb7, L'\\', 0x6b }, >=20 > + { BOXDRAW_DOUBLE_DOWN_LEFT, 0xbb, L'\\', 0x6b }, >=20 > + { BOXDRAW_UP_RIGHT_DOUBLE, 0xd4, L'\\', 0x6d }, >=20 > + { BOXDRAW_UP_DOUBLE_RIGHT, 0xd3, L'\\', 0x6d }, >=20 > + { BOXDRAW_DOUBLE_UP_RIGHT, 0xc8, L'\\', 0x6d }, >=20 > + { BOXDRAW_UP_LEFT_DOUBLE, 0xbe, L'/', 0x6a }, >=20 > + { BOXDRAW_UP_DOUBLE_LEFT, 0xbd, L'/', 0x6a }, >=20 > + { BOXDRAW_DOUBLE_UP_LEFT, 0xbc, L'/', 0x6a }, >=20 > + { BOXDRAW_VERTICAL_RIGHT_DOUBLE, 0xc6, L'|', 0x74 }, >=20 > + { BOXDRAW_VERTICAL_DOUBLE_RIGHT, 0xc7, L'|', 0x74 }, >=20 > + { BOXDRAW_DOUBLE_VERTICAL_RIGHT, 0xcc, L'|', 0x74 }, >=20 > + { BOXDRAW_VERTICAL_LEFT_DOUBLE, 0xb5, L'|', 0x75 }, >=20 > + { BOXDRAW_VERTICAL_DOUBLE_LEFT, 0xb6, L'|', 0x75 }, >=20 > + { BOXDRAW_DOUBLE_VERTICAL_LEFT, 0xb9, L'|', 0x75 }, >=20 > + { BOXDRAW_DOWN_HORIZONTAL_DOUBLE, 0xd1, L'+', 0x77 }, >=20 > + { BOXDRAW_DOWN_DOUBLE_HORIZONTAL, 0xd2, L'+', 0x77 }, >=20 > + { BOXDRAW_DOUBLE_DOWN_HORIZONTAL, 0xcb, L'+', 0x77 }, >=20 > + { BOXDRAW_UP_HORIZONTAL_DOUBLE, 0xcf, L'+', 0x76 }, >=20 > + { BOXDRAW_UP_DOUBLE_HORIZONTAL, 0xd0, L'+', 0x76 }, >=20 > + { BOXDRAW_DOUBLE_UP_HORIZONTAL, 0xca, L'+', 0x76 }, >=20 > + { BOXDRAW_VERTICAL_HORIZONTAL_DOUBLE, 0xd8, L'+', 0x6e }, >=20 > + { BOXDRAW_VERTICAL_DOUBLE_HORIZONTAL, 0xd7, L'+', 0x6e }, >=20 > + { BOXDRAW_DOUBLE_VERTICAL_HORIZONTAL, 0xce, L'+', 0x6e }, >=20 >=20 >=20 > - { BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*' }, >=20 > - { BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+' }, >=20 > + { BLOCKELEMENT_FULL_BLOCK, 0xdb, L'*', 0x61 }, >=20 > + { BLOCKELEMENT_LIGHT_SHADE, 0xb0, L'+', 0x61 }, >=20 >=20 >=20 > - { GEOMETRICSHAPE_UP_TRIANGLE, '^', L'^' }, >=20 > - { GEOMETRICSHAPE_RIGHT_TRIANGLE, '>', L'>' }, >=20 > - { GEOMETRICSHAPE_DOWN_TRIANGLE, 'v', L'v' }, >=20 > - { GEOMETRICSHAPE_LEFT_TRIANGLE, '<', L'<' }, >=20 > + { GEOMETRICSHAPE_UP_TRIANGLE, '^', L'^', L'^' }, >=20 > + { GEOMETRICSHAPE_RIGHT_TRIANGLE, '>', L'>', L'>' }, >=20 > + { GEOMETRICSHAPE_DOWN_TRIANGLE, 'v', L'v', L'v' }, >=20 > + { GEOMETRICSHAPE_LEFT_TRIANGLE, '<', L'<', L'<' }, >=20 >=20 >=20 > - { ARROW_LEFT, '<', L'<' }, >=20 > - { ARROW_UP, '^', L'^' }, >=20 > - { ARROW_RIGHT, '>', L'>' }, >=20 > - { ARROW_DOWN, 'v', L'v' }, >=20 > - >=20 > - { 0x0000, 0x00, L'\0' } >=20 > + { ARROW_LEFT, '<', L'<', L'<' }, >=20 > + { ARROW_UP, '^', L'^', L'^' }, >=20 > + { ARROW_RIGHT, '>', L'>', L'>' }, >=20 > + { ARROW_DOWN, 'v', L'v', L'v' }, >=20 > }; >=20 >=20 >=20 > CHAR16 mSetModeString[] =3D { ESC, '[', '=3D', '3', 'h', 0 }; >=20 > @@ -80,6 +78,8 @@ CHAR16 mSetCursorPositionString[] =3D { ESC, '[', '0',= '0', ';', > '0', '0', 'H', 0 > CHAR16 mCursorForwardString[] =3D { ESC, '[', '0', '0', 'C', 0 }; >=20 > CHAR16 mCursorBackwardString[] =3D { ESC, '[', '0', '0', 'D', 0 }; >=20 >=20 >=20 > +CHAR8 SetDecModeString[] =3D {ESC, 0x28, 0x30}; >=20 > +CHAR8 ExitDecModeString[] =3D {ESC, 0x28, 0x42}; >=20 > // >=20 > // Body of the ConOut functions >=20 > // >=20 > @@ -183,16 +183,19 @@ TerminalConOutOutputString ( > EFI_STATUS Status; >=20 > UINT8 ValidBytes; >=20 > CHAR8 CrLfStr[2]; >=20 > + CHAR8 DecChar; >=20 > + UINTN ModeSwitchLength; >=20 > // >=20 > // flag used to indicate whether condition happens which will cause >=20 > // return EFI_WARN_UNKNOWN_GLYPH >=20 > // >=20 > BOOLEAN Warning; >=20 >=20 >=20 > - ValidBytes =3D 0; >=20 > - Warning =3D FALSE; >=20 > - AsciiChar =3D 0; >=20 > - >=20 > + ValidBytes =3D 0; >=20 > + Warning =3D FALSE; >=20 > + AsciiChar =3D 0; >=20 > + DecChar =3D 0; >=20 > + ModeSwitchLength =3D LENGTH_DEC_ESCAPE; >=20 > // >=20 > // get Terminal device data structure pointer. >=20 > // >=20 > @@ -217,17 +220,104 @@ TerminalConOutOutputString ( > for (; *WString !=3D CHAR_NULL; WString++) { >=20 >=20 >=20 > switch (TerminalDevice->TerminalType) { >=20 > - >=20 > case TerminalTypePcAnsi: >=20 > - case TerminalTypeVt100: >=20 > - case TerminalTypeVt100Plus: >=20 > - case TerminalTypeTtyTerm: >=20 > - case TerminalTypeLinux: >=20 > + if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiCh= ar, > NULL)) { >=20 > + // >=20 > + // If it's not a graphic character convert Unicode to ASCII. >=20 > + // >=20 > + GraphicChar =3D (CHAR8)*WString; >=20 > + >=20 > + if (!(TerminalIsValidAscii (GraphicChar) || TerminalIsValidEfiCn= tlChar > (GraphicChar))) { >=20 > + // >=20 > + // when this driver use the OutputString to output control str= ing, >=20 > + // TerminalDevice->OutputEscChar is set to let the Esc char >=20 > + // to be output to the terminal emulation software. >=20 > + // >=20 > + if ((GraphicChar =3D=3D ESC) && TerminalDevice->OutputEscChar)= { >=20 > + GraphicChar =3D ESC; >=20 > + } else { >=20 > + GraphicChar =3D '?'; >=20 > + Warning =3D TRUE; >=20 > + } >=20 > + } >=20 > + >=20 > + AsciiChar =3D GraphicChar; >>From my point, the above assignment is useless. If you think same with me, = please remove it. >=20 > + } >=20 > + Length =3D 1; >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &Length, >=20 > + &GraphicChar >=20 > + ); >=20 > + >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } >=20 > + >=20 > + break; >=20 > case TerminalTypeXtermR6: >=20 > - case TerminalTypeVt400: >=20 > case TerminalTypeSCO: >=20 > + // >=20 > + // Box graphics are split into 2 types simple and advanced. >=20 > + // Simple are drawn with dec special graphics. >=20 > + // Advanced are drawn with utf8. >=20 > + // This checks for simple because they have a lower value than the > advanced. >=20 > + // >=20 > + if (TerminalIsValidTextGraphics (*WString, NULL, NULL, &DecChar) &= & > *WString < BOXDRAW_DOUBLE_HORIZONTAL) { >=20 > + if (!TerminalDevice->DecSpecialGraphicsMode) { >=20 > + ModeSwitchLength =3D LENGTH_DEC_ESCAPE; >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &ModeSwitchLength, >=20 > + (UINT8 *)SetDecModeString >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } >=20 > + TerminalDevice->DecSpecialGraphicsMode =3D TRUE; >=20 > + } >=20 >=20 >=20 > - if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiCh= ar)) { >=20 > + GraphicChar =3D DecChar; >=20 > + Length =3D 1; >=20 > + } else { >=20 > + if (TerminalDevice->DecSpecialGraphicsMode) { >=20 The ModeSwitchLength should be initialized. Because it value would be chang= ed in the loop. > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &ModeSwitchLength, >=20 > + (UINT8 *)ExitDecModeString >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } >=20 > + >=20 > + TerminalDevice->DecSpecialGraphicsMode =3D FALSE; >=20 > + } >=20 > + UnicodeToUtf8 (*WString, &Utf8Char, &ValidBytes); >=20 > + Length =3D ValidBytes; >=20 > + } >=20 > + >=20 > + if (ValidBytes) { >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &Length, >=20 > + (UINT8 *)&Utf8Char >=20 > + ); >=20 > + ValidBytes =3D 0; >=20 > + } else { >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &Length, >=20 > + &GraphicChar >=20 > + ); >=20 > + } >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } >=20 > + >=20 > + break; >=20 > + case TerminalTypeVt100: >=20 > + case TerminalTypeTtyTerm: >=20 > + if (!TerminalIsValidTextGraphics (*WString, &GraphicChar, &AsciiCh= ar, > NULL)) { >=20 > // >=20 > // If it's not a graphic character convert Unicode to ASCII. >=20 > // >=20 > @@ -239,8 +329,8 @@ TerminalConOutOutputString ( > // TerminalDevice->OutputEscChar is set to let the Esc char >=20 > // to be output to the terminal emulation software. >=20 > // >=20 > - if ((GraphicChar =3D=3D 27) && TerminalDevice->OutputEscChar) = { >=20 > - GraphicChar =3D 27; >=20 > + if ((GraphicChar =3D=3D ESC) && TerminalDevice->OutputEscChar)= { >=20 > + GraphicChar =3D ESC; >=20 > } else { >=20 > GraphicChar =3D '?'; >=20 > Warning =3D TRUE; >=20 > @@ -248,14 +338,73 @@ TerminalConOutOutputString ( > } >=20 >=20 >=20 > AsciiChar =3D GraphicChar; >=20 > - >=20 > } >=20 >=20 >=20 > - if (TerminalDevice->TerminalType !=3D TerminalTypePcAnsi) { >=20 > - GraphicChar =3D AsciiChar; >=20 > + GraphicChar =3D AsciiChar; >=20 > + >=20 > + Length =3D 1; >=20 > + >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &Length, >=20 > + &GraphicChar >=20 > + ); >=20 > + >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > } >=20 >=20 >=20 > + break; Indent alignment. >=20 > + case TerminalTypeVt100Plus: >=20 > + case TerminalTypeVt400: >=20 > Length =3D 1; >=20 > + if (TerminalIsValidTextGraphics (*WString, NULL, NULL, &DecChar)) = { >=20 > + if (!TerminalDevice->DecSpecialGraphicsMode) { The above check cause the BLOCKELEMENT_FULL_BLOCK to ARROW_DOWN characters = to be write with switch string. Is that expected? >=20 > + ModeSwitchLength =3D LENGTH_DEC_ESCAPE; >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &ModeSwitchLength, >=20 > + (UINT8 *)SetDecModeString >=20 > + ); >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } It doesn't show on the email, but it has tailing whitespace in above line. = Please use "python ./BaseTools/Scripts/PatchCheck.py -1" to check the codi= ng issue. Thanks, Zhichao >=20 > + TerminalDevice->DecSpecialGraphicsMode =3D TRUE; >=20 > + } >=20 > + >=20 > + GraphicChar =3D DecChar; >=20 > + } else { >=20 > + if (TerminalDevice->DecSpecialGraphicsMode) { >=20 > + ModeSwitchLength =3D LENGTH_DEC_ESCAPE; >=20 > + Status =3D TerminalDevice->SerialIo->Write ( >=20 > + TerminalDevice->SerialIo, >=20 > + &ModeSwitchLength, >=20 > + (UINT8 *)ExitDecModeString >=20 > + ); >=20 > + >=20 > + if (EFI_ERROR (Status)) { >=20 > + goto OutputError; >=20 > + } >=20 > + >=20 > + TerminalDevice->DecSpecialGraphicsMode =3D FALSE; >=20 > + } >=20 > + >=20 > + GraphicChar =3D (CHAR8)*WString; >=20 > + >=20 > + if (!(TerminalIsValidAscii (GraphicChar) || TerminalIsValidEfiCn= tlChar > (GraphicChar))) { >=20 > + // >=20 > + // when this driver use the OutputString to output control str= ing, >=20 > + // TerminalDevice->OutputEscChar is set to let the Esc char >=20 > + // to be output to the terminal emulation software. >=20 > + // >=20 > + if ((GraphicChar =3D=3D ESC) && TerminalDevice->OutputEscChar)= { >=20 > + GraphicChar =3D ESC; >=20 > + } else { >=20 > + GraphicChar =3D '?'; >=20 > + Warning =3D TRUE; >=20 > + } >=20 > + } >=20 > + } >=20 >=20 >=20 > Status =3D TerminalDevice->SerialIo->Write ( >=20 > TerminalDevice->SerialIo, >=20 > @@ -268,7 +417,7 @@ TerminalConOutOutputString ( > } >=20 >=20 >=20 > break; >=20 > - >=20 > + case TerminalTypeLinux: >=20 > case TerminalTypeVtUtf8: >=20 > UnicodeToUtf8 (*WString, &Utf8Char, &ValidBytes); >=20 > Length =3D ValidBytes; >=20 > @@ -280,8 +429,10 @@ TerminalConOutOutputString ( > if (EFI_ERROR (Status)) { >=20 > goto OutputError; >=20 > } >=20 > + >=20 > break; >=20 > } >=20 > + >=20 > // >=20 > // Update cursor position. >=20 > // >=20 > @@ -875,7 +1026,8 @@ BOOLEAN > TerminalIsValidTextGraphics ( >=20 > IN CHAR16 Graphic, >=20 > OUT CHAR8 *PcAnsi, OPTIONAL >=20 > - OUT CHAR8 *Ascii OPTIONAL >=20 > + OUT CHAR8 *Ascii, OPTIONAL >=20 > + OUT CHAR8 *DecSpecialGraphics OPTIONAL >=20 > ) >=20 > { >=20 > UNICODE_TO_CHAR *Table; >=20 > @@ -897,6 +1049,9 @@ TerminalIsValidTextGraphics ( > if (Ascii !=3D NULL) { >=20 > *Ascii =3D Table->Ascii; >=20 > } >=20 > + if (DecSpecialGraphics !=3D NULL){ >=20 > + *DecSpecialGraphics =3D Table->DecSpecialGraphics; >=20 > + } >=20 >=20 >=20 > return TRUE; >=20 > } >=20 > -- > 2.33.0