Beware P3Dv4 scenery.cfg encoding changes

#1
Discovered a little thing to be aware of with Prepar3d v4 today.

The scenery.cfg when installed clean is encoded as ANSI, as per previous versions of the sim. If users add scenery via installers into this it should all work fine.

However...

If you delete the scenery.cfg from P3D v4 and the sim regenerates a new one, it is encoded as UNICODE. Subsequently if you try and install some 3rd party software into it, you'll end up with chinese characters and the scenery.cfg losing all entries. (see attached)

So, if anyone is using Prepar3d v4 be aware of this issue. It is a simple fix to open the scenery.cfg file in notepad.exe and save as scenery.cfg and ensure the file is encoded to ANSI. This will ensure it should all work as before.

As for updating code for how to encode and update the scenery.cfg to UNICODE on the Setup Factory code side.
 

Attachments

MOUSY

Resource contributor
#2
I noticed this behaviour as well, a few weeks ago. Imagine my dismay when I had tested my Scenery Managers on 2 different installations of P34, only to release my product and get various reports of slow performance and weird characters! I had to figure out how to rewrite all my managers to figure out which encoding it was in and read both types. (Luckily it turned out to be not too hard for my coding environment)

Best practice would actually be to save the file in whatever encoding it is presently in.
But as we already know. Not all developers will follow this rule and some make a mess of things all together! (If I had a dollar for everytime I had to have a user email me there files so I could save it back in the proper encoding... :rolleyes:)
 

n4gix

Resource contributor
#3
FWIW, per L-M the defacto standard from now on will be UNICODE. This is being done to better support full localization of native language for users.
 
#6
Yes, I would say that with v4, it's time to embrace what LM have given us. There are two ways you can do this, either using the add-on.xml method, or the command-line method, which called Prepar3d to do the work of adding your entry to the Scenery.cfg. So you can replace all your script with a single command-line call.
 
#7
Oh God,

I just have it, no way to restore it back, lucky I had not to much sceneries installed and I have add them again manually, those where the installation was via the new P3D way was not touched and was back at the scenery.cfg from alone!
 
Top