Skip to content

Commit

Permalink
Merge pull request #171 from peace-maker/msvc_codepage_localization
Browse files Browse the repository at this point in the history
Fix Windows codepage detection when using language pack
  • Loading branch information
psychonic authored Dec 15, 2024
2 parents 551dd3f + 6792f69 commit 545cebd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ambuild2/frontend/cpp/msvc_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,10 @@ def GetCodePage():
stdout = subprocess.PIPE,
stderr = subprocess.DEVNULL,
stdin = subprocess.DEVNULL).stdout
codec = 'cp' + re.match(b".+: (\d+)\s*$", stdout).group(1).decode()
code_page = re.match(br".+: (\d+)\.?\s*$", stdout)
if code_page is None:
raise LookupError("Could not determine code page")
codec = 'cp' + code_page.group(1).decode()
codecs.lookup(codec)
return codec
except LookupError:
Expand Down

0 comments on commit 545cebd

Please sign in to comment.