# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.<BR>\r
#\r
# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>\r
-# This program and the accompanying materials\r
-# are licensed and made available under the terms and conditions of the BSD License\r
-# which accompanies this distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
##\r
# Import Modules\r
from Common.BuildToolError import *\r
from Common.StringUtils import GetLineNo\r
from Common.Misc import PathClass\r
-from Common.LongFilePathSupport import LongFilePath, UniToStr\r
+from Common.LongFilePathSupport import LongFilePath\r
from Common.GlobalData import *\r
##\r
# Static definitions\r
## GetLanguageCode\r
#\r
# Check the language code read from .UNI file and convert ISO 639-2 codes to RFC 4646 codes if appropriate\r
-# ISO 639-2 language codes supported in compatiblity mode\r
+# ISO 639-2 language codes supported in compatibility mode\r
# RFC 4646 language codes supported in native mode\r
#\r
# @param LangName: Language codes read from .UNI file\r
#\r
-# @retval LangName: Valid lanugage code in RFC 4646 format or None\r
+# @retval LangName: Valid language code in RFC 4646 format or None\r
#\r
def GetLanguageCode(LangName, IsCompatibleMode, File):\r
length = len(LangName)\r
if EndPos != -1 and EndPos - StartPos == 6 :\r
if g4HexChar.match(Line[StartPos + 2 : EndPos], re.UNICODE):\r
EndStr = Line[EndPos: ]\r
- UniStr = ('\u' + (Line[StartPos + 2 : EndPos])).decode('unicode_escape')\r
+ UniStr = Line[StartPos + 2: EndPos]\r
if EndStr.startswith(u'\\x') and len(EndStr) >= 7:\r
if EndStr[6] == u'\\' and g4HexChar.match(EndStr[2 : 6], re.UNICODE):\r
Line = Line[0 : StartPos] + UniStr + EndStr\r