Skip to content

Commit

Permalink
Change mbcs encoding to utf-8 in com/win32com/client (#2097)
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam authored Nov 1, 2023
1 parent ea43be2 commit 309a8b0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 0 additions & 3 deletions Pythonwin/pywin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@
# others are looking at it, but it will go away soon!
is_platform_unicode = 0

# Ditto default_platform_encoding - not referenced and will die.
default_platform_encoding = "mbcs"

# This one *is* real and used - but in practice can't be changed.
default_scintilla_encoding = "utf-8" # Scintilla _only_ supports this ATM
2 changes: 0 additions & 2 deletions Pythonwin/pywin/tools/hierlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ def AddItem(self, parentHandle, item, hInsertAfter=commctrl.TVI_LAST):
bitmapSel = self.GetSelectedBitmapColumn(item)
if bitmapSel is None:
bitmapSel = bitmapCol
## if isinstance(text, str):
## text = text.encode("mbcs")
hitem = self.listControl.InsertItem(
parentHandle,
hInsertAfter,
Expand Down
4 changes: 2 additions & 2 deletions com/win32com/client/genpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ def BuildOleItemsFromType(self):

return oleItems, enumItems, recordItems, vtableItems

def open_writer(self, filename, encoding="mbcs"):
def open_writer(self, filename, encoding="utf-8"):
# A place to put code to open a file with the appropriate encoding.
# Does *not* set self.file - just opens and returns a file.
# Actually returns a handle to a temp file - finish_writer then deletes
Expand Down Expand Up @@ -1097,7 +1097,7 @@ def do_gen_file_header(self):
# We assert this is it may indicate somewhere in pywin32 that needs
# upgrading.
assert self.file.encoding, self.file
encoding = self.file.encoding # or "mbcs"
encoding = self.file.encoding

print(f"# -*- coding: {encoding} -*-", file=self.file)
print(f"# Created by makepy.py version {makepy_version}", file=self.file)
Expand Down

0 comments on commit 309a8b0

Please sign in to comment.