summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c')
-rw-r--r--EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c190
1 files changed, 3 insertions, 187 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c
index 094c36652a..bba93bdaaf 100644
--- a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c
+++ b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c
@@ -31,190 +31,7 @@ Module Name:
#include <Library/MemoryAllocationLib.h>
#include <Library/HiiLib.h>
#include <Library/BaseMemoryLib.h>
-
-
-///
-/// The size of a 3 character ISO639 language code.
-///
-#define ISO_639_2_ENTRY_SIZE 3
-
-//
-// Lookup table of ISO639-2 3 character language codes to ISO 639-1 2 character language codes
-// Each entry is 5 CHAR8 values long. The first 3 CHAR8 values are the ISO 639-2 code.
-// The last 2 CHAR8 values are the ISO 639-1 code.
-//
-GLOBAL_REMOVE_IF_UNREFERENCED CONST CHAR8 Iso639ToRfc4646ConversionTable[] =
-"\
-aaraa\
-abkab\
-afraf\
-amham\
-araar\
-asmas\
-aymay\
-azeaz\
-bakba\
-belbe\
-benbn\
-bihbh\
-bisbi\
-bodbo\
-brebr\
-bulbg\
-catca\
-cescs\
-corkw\
-cosco\
-cymcy\
-danda\
-deude\
-dzodz\
-ellel\
-engen\
-epoeo\
-estet\
-euseu\
-faofo\
-fasfa\
-fijfj\
-finfi\
-frafr\
-fryfy\
-gaiga\
-gdhgd\
-glggl\
-grngn\
-gujgu\
-hauha\
-hebhe\
-hinhi\
-hrvhr\
-hunhu\
-hyehy\
-ikuiu\
-ileie\
-inaia\
-indid\
-ipkik\
-islis\
-itait\
-jawjw\
-jpnja\
-kalkl\
-kankn\
-kasks\
-katka\
-kazkk\
-khmkm\
-kinrw\
-kirky\
-korko\
-kurku\
-laolo\
-latla\
-lavlv\
-linln\
-litlt\
-ltzlb\
-malml\
-marmr\
-mkdmk\
-mlgmg\
-mltmt\
-molmo\
-monmn\
-mrimi\
-msams\
-myamy\
-nauna\
-nepne\
-nldnl\
-norno\
-ocioc\
-ormom\
-panpa\
-polpl\
-porpt\
-pusps\
-quequ\
-rohrm\
-ronro\
-runrn\
-rusru\
-sagsg\
-sansa\
-sinsi\
-slksk\
-slvsl\
-smise\
-smosm\
-snasn\
-sndsd\
-somso\
-sotst\
-spaes\
-sqisq\
-srpsr\
-sswss\
-sunsu\
-swasw\
-swesv\
-tamta\
-tattt\
-telte\
-tgktg\
-tgltl\
-thath\
-tsnts\
-tuktk\
-twitw\
-uigug\
-ukruk\
-urdur\
-uzbuz\
-vievi\
-volvo\
-wolwo\
-xhoxh\
-yidyi\
-zhaza\
-zhozh\
-zulzu\
-";
-
-/**
- Convert language code from RFC4646 to ISO639-2.
-
- @param LanguageRfc4646 RFC4646 language code.
- @param LanguageIso639 ISO639-2 language code.
-
- @retval EFI_SUCCESS Language code converted.
- @retval EFI_NOT_FOUND Language code not found.
-
-**/
-EFI_STATUS
-EFIAPI
-ConvertRfc4646LanguageToIso639Language (
- IN CHAR8 *LanguageRfc4646,
- OUT CHAR8 *LanguageIso639
- )
-{
- UINTN Index;
-
- if ((LanguageRfc4646[2] != '-') && (LanguageRfc4646[2] != 0)) {
- CopyMem (LanguageIso639, LanguageRfc4646, 3);
- return EFI_SUCCESS;
- }
-
- for (Index = 0; Iso639ToRfc4646ConversionTable[Index] != 0; Index += 5) {
- if (CompareMem (LanguageRfc4646, &Iso639ToRfc4646ConversionTable[Index + 3], 2) == 0) {
- CopyMem (LanguageIso639, &Iso639ToRfc4646ConversionTable[Index], 3);
- return EFI_SUCCESS;
- }
- }
-
- return EFI_NOT_FOUND;
-}
+#include <Library/LanguageLib.h>
/**
Performs a case-insensitive comparison of two Null-terminated Unicode
@@ -427,10 +244,9 @@ Uc2NotificationEvent (
//
// Fill in rest of private data structure
//
- Private->UC.SupportedLanguages = AllocateZeroPool (ISO_639_2_ENTRY_SIZE + 1);
- Status = ConvertRfc4646LanguageToIso639Language (Private->UC2->SupportedLanguages, Private->UC.SupportedLanguages);
+ Private->UC.SupportedLanguages = ConvertLanguagesRfc4646ToIso639 (Private->UC2->SupportedLanguages);
- if (!EFI_ERROR (Status)) {
+ if (Private->UC.SupportedLanguages != NULL) {
//
// Install Firmware Volume Protocol onto same handle