jenkins-bot submitted this change.
[bugfix] Fix cp encodings in reflinks.py
Bug: T304830
Change-Id: I58180ea163c2b376b5944f354912a1162bd45d02
---
M scripts/reflinks.py
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index f4aa58e..b87180f 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -562,10 +562,12 @@
if enc:
# Use encoding if found. Else use chardet apparent encoding
encoding = enc.group('enc').strip('"\' ').lower()
- naked = re.sub(r'[ _\-]', '', encoding)
# Convert to python correct encoding names
- if naked == 'xeucjp':
+ if re.sub(r'[ _\-]', '', encoding) == 'xeucjp':
encoding = 'euc_jp'
+ else:
+ # fix cp encodings (T304830)
+ encoding = re.sub(r'\Acp[ _\-](\d{3,4})', r'cp\1', encoding)
return encoding
return None
To view, visit change 774862. To unsubscribe, or for help writing mail filters, visit settings.