Skip to content

Commit 52e9a9e

Browse files
committed
Fix: Printing Unicode characters in NFO was broken. Also added regression for it.
1 parent 4cdd8b5 commit 52e9a9e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

nml/output_nfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def print_string(self, value, final_zero = True, force_ascii = False):
8282
if not grfstrings.is_ascii_string(value):
8383
if force_ascii:
8484
raise generic.ScriptError("Expected ascii string but got a unicode string")
85-
self.file.write('\xC3\x9E'.decode('utf-8'))
85+
self.file.write('Þ') # b'\xC3\x9E'.decode('utf-8')
8686
self.file.write(value.replace('"', '\\"'))
8787
self.byte_count += grfstrings.get_string_size(value, final_zero, force_ascii)
8888
self.file.write('" ')
7 Bytes
Binary file not shown.

regression/expected/007_townnames.nfo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
01 01 00 01 01 "tiny village" 00
2121

2222

23-
2 * 73 0F 82
23+
2 * 80 0F 82
2424
00 "US Stations" 00
2525
1F "Test stationnnetjes" 00
26-
7F "Test Stations" 00
26+
7F "ÞTeßt Stätiöµſ" 00
2727
00
2828
01 03 0A 04 0A "MainCapital" 00
2929
85 00

regression/lang/english.lng

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ STR_PARAM_LANDSCAPE_ARCTIC :arctic (not implemented)
2525
STR_PARAM_LANDSCAPE_TROPICAL :tropical (not implemented)
2626
STR_PARAM_LANDSCAPE_TOYLAND :toyland (not implemented)
2727

28-
STR_STATIONS :Test Stations
28+
STR_STATIONS :Teßt Stätiöµſ
2929

3030
STR_OBJ_MISC_CLASS :Miscellaneous
3131
STR_OBJ_BASIC :Basic object
@@ -36,4 +36,4 @@ STR_COALMINE_MONTH_11 :{BLACK}diamonds
3636

3737
STR_BREWERY_NAME :Brewery
3838

39-
STR_032_HOUSE :Example house
39+
STR_032_HOUSE :Example house

0 commit comments

Comments
 (0)