GothicKit / ZenKitCS

C#-bindings for ZenKit, the ZenGin asset parser.
https://zk.gothickit.dev/
MIT License
4 stars 1 forks source link

StringEncodingController.SetEncoding() isn't used by Daedalus External calls (e.g. ZSpy logs) #9

Closed JaXt0r closed 3 weeks ago

JaXt0r commented 3 months ago

In our gameplay, we initially set StringEncodingController.SetEncoding(StringEncoding.*); unaffected by it's value, we get the following ZSpy logs: image

It seems the external functions won't get the strings encoded.

I also tested it with a plain constant from daedalus. And I can directly read a cyrillic value like this. So normal string usage works with the StringEncodingController:

// We fetch one symbol from G1 which is translated differently in every language. With this, we can auto-suggest the used game language.
StringEncodingController.SetEncoding(StringEncoding.EastEurope);
var l10nSymbol = GameData.GothicVm.GetSymbolByName("MOBNAME_CRATE");
var l10nString = l10nSymbol.GetString(0);
Debug.Log(l10nString); // for russian:  Коробка - ok

ASK:
Can you please check if the encoding is being used for strings returned by Daedalus external functions?

lmichaelis commented 2 months ago

It is using the correct function: bilde bilde

JaXt0r commented 2 months ago

Hm... Did you test it on your end if it produces the same wrong behavior? If you provide a quick test on ZK.Tests, I can check it on my end later as well.

JaXt0r commented 3 weeks ago

Your fix solved the issue. Thanks.