From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 83E2E21A0480F for ; Wed, 26 Apr 2017 15:47:25 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Apr 2017 15:47:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,256,1488873600"; d="scan'208";a="850200408" Received: from orsmsx110.amr.corp.intel.com ([10.22.240.8]) by FMSMGA003.fm.intel.com with ESMTP; 26 Apr 2017 15:47:24 -0700 Received: from orsmsx159.amr.corp.intel.com (10.22.240.24) by ORSMSX110.amr.corp.intel.com (10.22.240.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 26 Apr 2017 15:47:24 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.59]) by ORSMSX159.amr.corp.intel.com ([169.254.11.110]) with mapi id 14.03.0319.002; Wed, 26 Apr 2017 15:47:23 -0700 From: "Kinney, Michael D" To: Tim Lewis , "edk2-devel@lists.01.org" , "Kinney, Michael D" CC: "Carsey, Jaben" , "Shaw, Kevin W" Thread-Topic: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on disk to be UTF-8 without a BOM Thread-Index: AQHSvimGOHKniHBBck6SNVtE4IZySaHXS+yAgAD9tQD//59LUIAAh4iA//+MdrCAAHj7AP//kJzw Date: Wed, 26 Apr 2017 22:47:23 +0000 Message-ID: References: <1493168839-11708-1-git-send-email-michael.d.kinney@intel.com> <1493168839-11708-2-git-send-email-michael.d.kinney@intel.com> <7236196A5DF6C040855A6D96F556A53F576347@msmail.insydesw.com.tw> <7236196A5DF6C040855A6D96F556A53F576544@msmail.insydesw.com.tw> <7236196A5DF6C040855A6D96F556A53F576599@msmail.insydesw.com.tw> In-Reply-To: <7236196A5DF6C040855A6D96F556A53F576599@msmail.insydesw.com.tw> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2UyYjg3MTctZTRmOC00NjdlLWJiNTctZTM2YmNmZWFmNDk2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6Ilwvc1hUQVR2U1BFQVkxN2dGZ0dwWDVxNEZwRmdMdUdMRks5a09NTmJjSjRNPSJ9 dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Subject: Re: [edk2-UniSpecification PATCH] Allow .uni files on disk to be UTF-8 without a BOM X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 22:47:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Tim, The recommendation for UTF-8 usage is to not use a BOM, which is why no BOM for UTF-8 was selected for EDK II. The current task is to update docs to match the current tool behavior. The EDK II repos on GitHub have .uni files in UTF-8 format without a BOM to support easier patch review. There are ways to use GIT features to auto-convert .uni files=20 when pulling content from EDK II repos and pushing commits. =20 That may or may not help with the specific issue you are raising. If you have ideas on a tool change request to EDK II that would=20 provide compatibility with current EDK II tool behavior and support UTF-16LE without a BOM, then let's work that through in a Bugzilla feature request. If we find a solution, we can update the docs and tools again. Do you have any objections to updating the UNI Spec to match the=20 current tool behavior? Thanks, Mike > -----Original Message----- > From: Tim Lewis [mailto:tim.lewis@insyde.com] > Sent: Wednesday, April 26, 2017 11:54 AM > To: Kinney, Michael D ; edk2-devel@lists.01.o= rg > Cc: Carsey, Jaben ; Shaw, Kevin W > > Subject: RE: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on dis= k to be > UTF-8 without a BOM >=20 > Mike -- >=20 > This is not about files in the EDK II repository. This is about files cre= ated > based on the spec, and created with other sets of tools. Go back to early= 2015, > to the Build spec (1.22, etc.), Appendix G, which is where the UNI stuff = used to > live. >=20 > The point is: files which worked before, and, at worst, generated a warni= ng > before, now are interpreted incorrectly even though they have correct dat= a. >=20 > Making ASCII (or UTF-8) the default without a BOM is the breaking change. >=20 > Tim >=20 > -----Original Message----- > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com] > Sent: Wednesday, April 26, 2017 11:47 AM > To: Tim Lewis ; edk2-devel@lists.01.org; Kinney, Mi= chael D > > Cc: Carsey, Jaben ; Shaw, Kevin W > > Subject: RE: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on dis= k to be > UTF-8 without a BOM >=20 > Tim, >=20 > If you look at the entire file history of the EDK II, you will see that t= he BOM > has always been present in the UTF-16LE formatted files. >=20 > The build tools were updated in 2015 to *add* support for UTF-8 file. > The .uni files in the EDK II project were then converted from UTF-16LE wi= th a BOM > to UTF-8 without a BOM. This provided an easier developer experience whe= n using > GIT to do email patch review of .uni files. >=20 > It is possible I am missing something here. Can you please provide a poi= nter to > the EDK II commit(s) where BOMs were added to UTF-16LE .uni files. >=20 > Thanks, >=20 > Mike >=20 > > -----Original Message----- > > From: Tim Lewis [mailto:tim.lewis@insyde.com] > > Sent: Wednesday, April 26, 2017 11:34 AM > > To: Kinney, Michael D ; > > edk2-devel@lists.01.org > > Cc: Carsey, Jaben ; Shaw, Kevin W > > > > Subject: RE: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on > > disk to be > > UTF-8 without a BOM > > > > Mike -- > > > > I understand that EDK2 has decided to add BOM markers two years ago. > > Adding a BOM didn't change the default. The problem is (a) there are > > still hundreds of files extant in our codebase which were created > > prior to the 2015 changes and still in use, and (b) this change is not = backward > compatible for these files. > > > > Tim > > > > -----Original Message----- > > From: Kinney, Michael D [mailto:michael.d.kinney@intel.com] > > Sent: Wednesday, April 26, 2017 11:11 AM > > To: Tim Lewis ; edk2-devel@lists.01.org; Kinney, > > Michael D > > Cc: Carsey, Jaben ; Shaw, Kevin W > > > > Subject: RE: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on > > disk to be > > UTF-8 without a BOM > > > > Hi Tim, > > > > This is not a request for a new change. Instead, the intent of this > > document change is to update the document to reflect the implemented > > behavior of the EDK II tools. The EDK II tool updates to add UTF-8 > > file support were completed with the patches listed below. Notice > > that the main one for normal build support was checked in almost 2 year= s ago. > > > > BaseTools - UniClassObject - 6/23/2015 > > * > > https://github.com/tianocore/edk2/commit/d80e451b187c9d33cbd771253fbd5 > > 119670f75c6 > > * > > https://github.com/tianocore/edk2/commit/be264422c95c781a345978f17b7e8 > > 0b91f816eda > > > > BaseTools - ECC - 12/29/2015 > > * > > https://github.com/tianocore/edk2/commit/975889279df2eb3d3338cb88afb3f > > aa71ddde4d6 > > > > BaseTools - UPT - 4/25/2016 > > * > > https://github.com/tianocore/edk2/commit/4a21fb3b67a0ef1655b43e9368b6b > > 697bbf327af > > > > This was intended to be a 100% backwards compatible change. > > > > All .uni files in the EDK II project in UTF-16LE format have always use= a BOM. > > Please checkout UDK2015 or older UDKs and you will see all .uni files > > start with 0xff 0xfe. > > > > Thanks, > > > > Mike > > > > > -----Original Message----- > > > From: Tim Lewis [mailto:tim.lewis@insyde.com] > > > Sent: Wednesday, April 26, 2017 9:15 AM > > > To: Kinney, Michael D ; > > > edk2-devel@lists.01.org > > > Cc: Carsey, Jaben ; Shaw, Kevin W > > > > > > Subject: RE: [edk2] [edk2-UniSpecification PATCH] Allow .uni files > > > on disk to be > > > UTF-8 without a BOM > > > > > > Mike -- > > > > > > This breaks our existing build tools, which assume that a file > > > without a BOM is UTF-16. > > > > > > Tim > > > > > > -----Original Message----- > > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf > > > Of Michael Kinney > > > Sent: Tuesday, April 25, 2017 6:07 PM > > > To: edk2-devel@lists.01.org > > > Cc: Jaben Carsey ; Kevin W Shaw > > > > > > Subject: [edk2] [edk2-UniSpecification PATCH] Allow .uni files on > > > disk to be UTF- > > > 8 without a BOM > > > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D507 > > > > > > Cc: Jaben Carsey > > > Cc: Yonghong Zhu > > > Cc: Kevin W Shaw > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > > Signed-off-by: Michael Kinney > > > --- > > > 2_unicode_strings_file_format.md | 9 ++++++--- > > > README.md | 27 ++++++++++++++------------- > > > 2 files changed, 20 insertions(+), 16 deletions(-) > > > > > > diff --git a/2_unicode_strings_file_format.md > > > b/2_unicode_strings_file_format.md > > > index 0150c85..7a4a019 100644 > > > --- a/2_unicode_strings_file_format.md > > > +++ b/2_unicode_strings_file_format.md > > > @@ -33,7 +33,8 @@ > > > > > > EDK II Unicode files are used for mapping token names to localized > > > strings that are identified by an RFC4646 language code. The format > > > for storing EDK II - Unicode files is UTF-16LE. The character > > > content must be > > UCS-2. > > > +Unicode files on disk is UTF-8 (without a BOM character) or > > > +UTF-16LE (with a BOM character). The character content must be UCS-2= . > > > > > > Strings ends are determined by the first of the following items foun= d: > > > > > > @@ -44,11 +45,13 @@ Strings ends are determined by the first of the > > > following items found: > > > > > > Comments may appear anywhere within the string file. > > > > > > -All the files must begin with a Unicode BOM character. > > > +All UTF-16LE files must begin with a Unicode BOM character. > > > +All UTF-8 files must not begin with a Unicode BOM character. > > > > > > ********** > > > **NOTE:** Please make sure you select an editor that supports UCS-2 > > > characters - that can be stored in a UTF-16LE file. > > > +that can be stored in either a UTF-8 (without a BOM character) or a > > > +UTF-16LE file (with a BOM character). > > > ********** > > > > > > ## 2.1 Common EBNF > > > diff --git a/README.md b/README.md > > > index 63842a1..015aef1 100644 > > > --- a/README.md > > > +++ b/README.md > > > @@ -77,16 +77,17 @@ Copyright (c) 2016-2017, Intel Corporation. All > > > rights reserved. > > > > > > ### Revision History > > > > > > -| Revision | Description > > > | Date | > > > -| ----------------- | > > > -| ---------------------------------------------------------- > > > ------------------------------ | --------------- | > > > -| 1.0 | Initial Release. > > > | February 2014 | > > > -| 1.1 | Updated EBNF to follow syntax specified in EBN= F by the > > > ANTLR project. | August 2014 | > > > -| | Added content related to EDK II Meta-Data Unic= ode > files. > > > | | > > > -| | Restructured document. > > > | | > > > -| | Removed security and C format GUID > > > -| definitions, not > > > required for HII or other UNI files. | | > > > -| | Removed invalid escape code sequences. > > > | | > > > -| 1.2 | Added optional font formatting > > > | September 2014 | > > > -| 1.2 Errata A | Correct misspelling of: `STR_PROPERTIES_MODULE= _NAME` > > > | April 2015 | > > > -| 1.3 | Added: Syntax for non-ascii characters inside = quoted > > > strings. | March 2016 | > > > -| | Removed: Info on specific consumers (.INF & > > > -| .DEC) > > removed. > > > | | > > > -| 1.4 | Convert to GitBook format > > > | March 2017 | > > > +| Revision | Description > > > | Date | > > > +| ----------------- | > > > +| ---------------------------------------------------------- > > > ------------------------------------------------------------ | > > > --------------- | > > > +| 1.0 | Initial Release. > > > | February 2014 | > > > +| 1.1 | Updated EBNF to follow syntax specified in EBN= F by the > > > ANTLR project. | Aug= ust 2014 > > > | > > > +| | Added content related to EDK II Meta-Data Unic= ode > files. > > > | | > > > +| | Restructured document. > > > | | > > > +| | Removed security and C format GUID > > > +| definitions, not > > > required for HII or other UNI files. | > > > | > > > +| | Removed invalid escape code sequences. > > > | | > > > +| 1.2 | Added optional font formatting > > > | September 2014 | > > > +| 1.2 Errata A | Correct misspelling of: `STR_PROPERTIES_MODULE= _NAME` > > > | April 2015 | > > > +| 1.3 | Added: Syntax for non-ascii characters inside = quoted > > > strings. | M= arch > 2016 > > > | > > > +| | Removed: Info on specific consumers (.INF & > > > +| .DEC) > > removed. > > > | | > > > +| 1.4 | Convert to GitBook format > > > | April 2017 | > > > +| | > > > +| [#507](https://bugzilla.tianocore.org/show_bug.cgi?id=3D507) > > > UNI Spec: Clarify that .uni files maybe UTF-8 without a BOM | > | > > > -- > > > 2.6.3.windows.1 > > > > > > _______________________________________________ > > > edk2-devel mailing list > > > edk2-devel@lists.01.org > > > https://lists.01.org/mailman/listinfo/edk2-devel