Problem with zgeproj file encoding

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
Ats
Posts: 862
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Problem with zgeproj file encoding

Post by Ats »

Hello, I have a nez weird problem today...
Do you happen to know what the file encoding of .zgeproj files is? I believe it’s UTF-8, right?

Since yesterday, when I open my project in Sublime Text and then open it in ZGameEditor, all the French characters are messed up. I can’t save my project in ZGameEditor anymore, otherwise everything will be broken afterward.

é → é
è → è
ù → ù
and so on...

It’s as if ZGameEditor is reading the file using Western (Windows-1252) encoding instead of UTF-8.
I tried opening my file with UTF-8 encoding in Sublime Text, and saving it as UTF-8 again, but when I open it in ZGameEditor, it still gets interpreted as Windows-1252.

That’s so weird. I haven’t changed anything in either ZGameEditor or Sublime Text.
Could a Windows update have caused this? (I had one yesterday...)
User avatar
Ats
Posts: 862
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with zgeproj file encoding

Post by Ats »

Never mind, I found it. The problem was coming from the .zgeproj's xml definition:
<?xml version="1.0" encoding="iso-8859-1" ?>
instead of
<?xml version="1.0" encoding="utf-8" ?>

I have no idea how this was changed... :shock:
User avatar
Ats
Posts: 862
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with zgeproj file encoding

Post by Ats »

All right, so it was ZGameEditor that put "iso-8859-1" in the XML encoding, so everything was normal after all.
But I made the mistake of saving my project from ZGE, so now all the éèù... characters are permanently broken. This time, they’ve all been replaced by "?", so I can’t even use search and replace to restore what I had.
I’ll gradually change my comments in the code to English whenever I stumble upon broken French words.

I still have no idea what happened in the first place. I’ll run some tests when I have some time.
User avatar
VilleK
Site Admin
Posts: 2393
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Problem with zgeproj file encoding

Post by VilleK »

Ats wrote: Fri Oct 17, 2025 11:43 am But I made the mistake of saving my project from ZGE, so now all the éèù... characters are permanently broken. This time, they’ve all been replaced by "?", so I can’t even use search and replace to restore what I had.
Always a good idea to keep .zgeproj files in source control so you can revert any mistakes :)
User avatar
Ats
Posts: 862
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: Problem with zgeproj file encoding

Post by Ats »

I have version control in Dropbox, but I often save more than the history limit allows. My SublimeText script saves the file in order to run it. I could try a revert, like I did yesterday, but this is the second time ZGE has broken all the characters in my years-long project in just two days. So I’m just letting it go.

The weird character problem appeared after the Windows update on my computer. Today, my laptop wants to do the same update, so I’ll run tests on both computers before letting the laptop update.
User avatar
VilleK
Site Admin
Posts: 2393
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Problem with zgeproj file encoding

Post by VilleK »

I should update ZGE so it uses utf-8 mode by default to avoid these issues.
Post Reply