Skip to content

Commit

Permalink
Added zerobytes parameter to common.writeEncodedString
Browse files Browse the repository at this point in the history
  • Loading branch information
Illidanz committed Jan 29, 2025
1 parent 86523ed commit e3eff7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hacktools/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.38.1"
__version__ = "0.38.2"
5 changes: 3 additions & 2 deletions hacktools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def detectASCIIString(f, encoding="ascii", startascii=[]):
return ret


def writeEncodedString(f, s, maxlen=0, encoding="shift_jis"):
def writeEncodedString(f, s, maxlen=0, encoding="shift_jis", zerobytes=1):
i = 0
x = 0
s = s.replace("~", "〜")
Expand Down Expand Up @@ -1000,7 +1000,8 @@ def writeEncodedString(f, s, maxlen=0, encoding="shift_jis"):
f.write(c.encode(encoding))
i += 2
x += 1
f.writeByte(0x00)
if zerobytes > 0:
f.writeZero(zerobytes)
return i


Expand Down

0 comments on commit e3eff7c

Please sign in to comment.