Add details comments for the code flow to initialize Unicode Collation (2) support.

(based on FatPkg commit 824fb80c85dfcb97662b8807c075c6cf7113b521)

[jordan.l.justen@intel.com: Use script to relicense to 2-clause BSD]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Mark Doran <mark.doran@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Qing Huang 2008-10-10 02:33:21 +00:00 committed by Jordan Justen
parent c3b8ec4310
commit 1f7de705d6
1 changed files with 14 additions and 0 deletions

View File

@ -162,6 +162,12 @@ InitializeUnicodeCollationSupportWithConfig (
/** /**
Initialize Unicode Collation support. Initialize Unicode Collation support.
This function searches Initialized Unicode Collation support based on PCDs:
PcdUnicodeCollation2Support and PcdUnicodeCollationSupport.
It first tries to locate Unicode Collation 2 protocol and matches it with current
platform language code. If for any reason the first attempt fails, it then tries to
use Unicode Collation Protocol.
@param AgentHandle The handle used to open Unicode Collation (2) protocol. @param AgentHandle The handle used to open Unicode Collation (2) protocol.
@retval EFI_SUCCESS The Unicode Collation (2) protocol has been successfully located. @retval EFI_SUCCESS The Unicode Collation (2) protocol has been successfully located.
@ -177,10 +183,18 @@ InitializeUnicodeCollationSupport (
EFI_STATUS Status; EFI_STATUS Status;
Status = EFI_UNSUPPORTED; Status = EFI_UNSUPPORTED;
//
// First try to use RFC 3066 Unicode Collation 2 Protocol.
//
if (FeaturePcdGet (PcdUnicodeCollation2Support)) { if (FeaturePcdGet (PcdUnicodeCollation2Support)) {
Status = InitializeUnicodeCollationSupportWithConfig (AgentHandle, &mRfc3066Lang); Status = InitializeUnicodeCollationSupportWithConfig (AgentHandle, &mRfc3066Lang);
} }
//
// If the attempt to use Unicode Collation 2 Protocol fails, then we fall back
// on the ISO 639-2 Unicode Collation Protocol.
//
if (FeaturePcdGet (PcdUnicodeCollationSupport) && EFI_ERROR (Status)) { if (FeaturePcdGet (PcdUnicodeCollationSupport) && EFI_ERROR (Status)) {
Status = InitializeUnicodeCollationSupportWithConfig (AgentHandle, &mIso639Lang); Status = InitializeUnicodeCollationSupportWithConfig (AgentHandle, &mIso639Lang);
} }