Skip to content

Commit

Permalink
Strip non-ASCII chars from signs when WB-saving
Browse files Browse the repository at this point in the history
This BtS bug has been reported here:
https://forums.civfanatics.com/threads/ctd-python-error.684770/

Had likely resulted in an unusable WB save file or none. [advc.001]
  • Loading branch information
f1rpo committed Jul 24, 2023
1 parent 99f31a4 commit f341d60
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Assets/Python/pyWB/CvWBDesc.py
Expand Up @@ -1473,7 +1473,10 @@ def write(self, f, sign):
f.write("\tplotX=%d\n" %(sign.getPlot().getX(),))
f.write("\tplotY=%d\n" %(sign.getPlot().getY(),))
f.write("\tplayerType=%d\n" %(sign.getPlayerType(),))
f.write("\tcaption=%s\n" %(sign.getCaption(),))
uCaption = sign.getCaption()
# advc.001: Strip non-ascii
uCaption = uCaption.encode('ascii', 'ignore').decode()
f.write("\tcaption=%s\n" %(uCaption,))
f.write("EndSign\n")

def read(self, f):
Expand Down

0 comments on commit f341d60

Please sign in to comment.