Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Characters corrupted - linux files #21

Open
krasnyii opened this issue Nov 10, 2018 · 3 comments · May be fixed by #44
Open

Characters corrupted - linux files #21

krasnyii opened this issue Nov 10, 2018 · 3 comments · May be fixed by #44

Comments

@krasnyii
Copy link

Opening a .dat file from Wargame Red Dragon (Linux version) - for instance "ZZ_linux.dat" corrupt the characters (replacing them with boxes ▯)
(See image)
If I save the file and load it into the game, the names are corrupted.
If i replace the boxes ▯ with plain letters and load it into the game, the names are (more!) corrupted.

It would be a pleasure to fix this issue, it would offer a way to port mods on linux :)

questionmoddingsuite

@RemiGC
Copy link
Contributor

RemiGC commented Jun 12, 2021

I'm investigating this. Some text entries in Linux are encoded as UTF32 and takes four bytes instead of two. Part of the fix is rather simple.

image

However implementing it without some ugly hack is harder. I still haven't found a way to know for sure the type of strings uses in a file, without resorting to encoding detection or looking at the file name.

image

@is-consulting
Copy link
Owner

I just checked wether the header contains any inforrmation about the encoding we havent understood earlier but it sadly doesnt look like it.

Encoding detection on a plain byte array representing the string is not easy.
A way might be to test the two known encodings and checking the result for known characters like the alphabet. That would introduce problems in non latin files... Good question.

@is-consulting
Copy link
Owner

Maybe issue #22 can be fixed as well while someone is working on this.

@RemiGC RemiGC linked a pull request Jun 24, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants