diff --git a/d2common/d2fileformats/d2tbl/text_dictionary.go b/d2common/d2fileformats/d2tbl/text_dictionary.go index 35540073..863b92e8 100644 --- a/d2common/d2fileformats/d2tbl/text_dictionary.go +++ b/d2common/d2fileformats/d2tbl/text_dictionary.go @@ -235,6 +235,7 @@ func (td *TextDictionary) Marshal() []byte { // data stream: put all data in appropriate order for _, key := range keys { value := (*td)[key] + for _, i := range key { sw.PushBytes(byte(i)) } diff --git a/d2common/d2fileformats/d2tbl/text_dictionary_test.go b/d2common/d2fileformats/d2tbl/text_dictionary_test.go index 26188cd5..20267803 100644 --- a/d2common/d2fileformats/d2tbl/text_dictionary_test.go +++ b/d2common/d2fileformats/d2tbl/text_dictionary_test.go @@ -8,7 +8,7 @@ func exampleData() *TextDictionary { result := &TextDictionary{ "abc": "def", "someStr": "Some long string", - "teststring": "TeSt", + "teststring": "TeStxwsas123 long strin122*8:wq", } return result @@ -27,7 +27,7 @@ func TestTBL_Marshal(t *testing.T) { newValue, ok := newTbl[key] if !ok { - t.Fatal("string wasn't encoded to table") + t.Fatalf("string %s wasn't encoded to table", key) } if newValue != value {