diff options
author | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 08:46:28 +0000 |
---|---|---|
committer | rsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-04-16 08:46:28 +0000 |
commit | ad5a96ab2daeeac53f0c924113f23dc931f965c5 (patch) | |
tree | a11c8b0b96a6b52fda679436870e7ac3d87142d3 /EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk | |
parent | 887c077d91a648a5e206cc19790878ebf521745e (diff) | |
download | edk2-platforms-ad5a96ab2daeeac53f0c924113f23dc931f965c5.tar.xz |
Retire language conversion APIs from HII library class.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8104 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk')
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c | 178 | ||||
-rw-r--r-- | EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.inf | 1 |
2 files changed, 179 insertions, 0 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c index 8fbffce05f..76fec60269 100644 --- a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c +++ b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.c @@ -30,6 +30,7 @@ Module Name: #include <Library/UefiLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/HiiLib.h>
+#include <Library/BaseMemoryLib.h>
///
@@ -37,6 +38,183 @@ Module Name: ///
#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 Iso639ToRfc3066ConversionTable[] =
+"\
+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 RFC3066 to ISO639-2.
+
+ @param LanguageRfc3066 RFC3066 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
+ConvertRfc3066LanguageToIso639Language (
+ IN CHAR8 *LanguageRfc3066,
+ OUT CHAR8 *LanguageIso639
+ )
+{
+ UINTN Index;
+
+ if ((LanguageRfc3066[2] != '-') && (LanguageRfc3066[2] != 0)) {
+ CopyMem (LanguageIso639, LanguageRfc3066, 3);
+ return EFI_SUCCESS;
+ }
+
+ for (Index = 0; Iso639ToRfc3066ConversionTable[Index] != 0; Index += 5) {
+ if (CompareMem (LanguageRfc3066, &Iso639ToRfc3066ConversionTable[Index + 3], 2) == 0) {
+ CopyMem (LanguageIso639, &Iso639ToRfc3066ConversionTable[Index], 3);
+ return EFI_SUCCESS;
+ }
+ }
+
+ return EFI_NOT_FOUND;
+}
/**
Performs a case-insensitive comparison of two Null-terminated Unicode
diff --git a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.inf b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.inf index ffe2d3f29c..600a0e6d84 100644 --- a/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.inf +++ b/EdkCompatibilityPkg/Compatibility/UcOnUc2Thunk/UcOnUc2Thunk.inf @@ -53,6 +53,7 @@ UefiLib
MemoryAllocationLib
HiiLib
+ BaseMemoryLib
[Protocols]
gEfiUnicodeCollation2ProtocolGuid
|