From 5e25b6389ccd10f52bd917d73e463781106f808c Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 14 Nov 2014 11:45:26 -0500 Subject: [PATCH 1/2] Make check-includes.py properly report bad UTF-8 on all platforms rather than crashing on Python 3. Doesn't really belong there, but just removing the check doesn't feel like a good idea. --- Tools/check-includes.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Tools/check-includes.py b/Tools/check-includes.py index d8d1c33c0d..0c2aee3832 100755 --- a/Tools/check-includes.py +++ b/Tools/check-includes.py @@ -76,7 +76,16 @@ def show_differences(bad, good): def check_file(path): print('Checking %s' % path) - lines = (l.strip() for l in open(path).read().split('\n')) + try: + try: + data = open(path, encoding='utf-8').read() + except TypeError: # py2 + data = open(path).read().decode('utf-8') + except UnicodeDecodeError: + sys.stderr.write('%s: bad UTF-8 data\n' % path) + return + + lines = (l.strip() for l in data.split('\n')) lines = exclude_if_blocks(lines) includes = list(filter_includes(lines)) sorted_includes = sort_includes(includes) From 0cf8ab175b26ba0c40cd1fa902b15457bcc3eb43 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 14 Nov 2014 11:49:28 -0500 Subject: [PATCH 2/2] Fix UCodes.cpp to use UTF-8 encoding. --- Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp index a72929fe90..079a29d819 100644 --- a/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp +++ b/Source/Core/Core/HW/DSPHLE/UCodes/UCodes.cpp @@ -46,7 +46,7 @@ UCodeInterface* UCodeFactory(u32 crc, DSPHLE *dsphle, bool wii) // nddemo, Star Fox case 0x07f88145: // bustamove, Ikaruga, F-Zero GX, Robotech Battle Cry, Star Soldier, Soul Calibur 2, // Zelda:OOT, Tony Hawk, Viewtiful Joe - case 0xe2136399: // Billy Hatcher, Dragon Ball Z, Mario Party 5, TMNT, 1080° Avalanche + case 0xe2136399: // Billy Hatcher, Dragon Ball Z, Mario Party 5, TMNT, 1080° Avalanche case 0x3389a79e: // MP1/MP2 Wii (Metroid Prime Trilogy) INFO_LOG(DSPHLE, "CRC %08x: AX ucode chosen", crc); return new AXUCode(dsphle, crc);