February 18, 20197 yr When I check for encoding errors in P4AO, I get a message identifying an incorrect character encoding in C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg file. Is this normal and can it ignored?
February 18, 20197 yr Commercial Member 4 hours ago, LecLightning56 said: When I check for encoding errors in P4AO, I get a message identifying an incorrect character encoding in C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg file. Is this normal and can it ignored? Yes, you can usually ignore it. The message should be gone when you press "Save" in P4AO. Best regards LORBY-SI
March 16, 20197 yr On 2/18/2019 at 12:42 PM, Lorby_SI said: Yes, you can usually ignore it. The message should be gone when you press "Save" in P4AO. Best regards Mine doesn't. Actually never happened before until these days. How can I fix it? Thanks! Best regards, Wanthuyr Filho Instagram: AeroTacto
March 16, 20197 yr Commercial Member 2 hours ago, Wanthuyr Filho said: Mine doesn't. Actually never happened before until these days. How can I fix it? Thanks! As long as your simulator works, you don't have to fix it. These things usually happen when a non-spec installer or a user manipulates the add-on.cfg files directly using unsuitable means. Those files are not to be tampered with. The proper way to make P3D aware of a new addon is to either use the P3D CLI as described in detail in the Learning Center, or the P3D Autodiscovery folder in \Documents. btw: CFG files have to be encoded in UTF-16 (UCS-2 LE BOM in Notepad++) There was a sticky thread to that effect in the Prepar3D subforum once, but it has disappeared now. Best regards Edited March 16, 20197 yr by Lorby_SI LORBY-SI
July 2, 20205 yr On 3/16/2019 at 8:37 AM, Lorby_SI said: CFG files have to be encoded in UTF-16 (UCS-2 LE BOM in Notepad++) There was a sticky thread to that effect in the Prepar3D subforum once, but it has disappeared now. Hi Oliver, This doesn't seem to be the case in P3D v5 anymore. I changed a number of xmls to UTF-16 and P3D simply didn't load them. I changed them back and they worked again. Perhaps it would make sense to rethink the warning message or question the usefulness of the "check encoding" feature. Kind regards, Alan
July 2, 20205 yr Commercial Member 21 minutes ago, AlanB77L said: Hi Oliver, This doesn't seem to be the case in P3D v5 anymore. I changed a number of xmls to UTF-16 and P3D simply didn't load them. I changed them back and they worked again. Perhaps it would make sense to rethink the warning message or question the usefulness of the "check encoding" feature. My post was about CFG files, not XML. The XML files are a completely different story. When you play around with the encoding of XML files, be mindful of the text declaration. It should always match the actual encoding, or a parser might refuse to read the file. P4AO will create all XML files in UTF-8 BOM, and add a matching text declaration. Please check the XML specification here: https://www.w3.org/TR/xml/#TextEntities Section 4.3.1 and 4.3.3 The point of the warning message is, that a user or a program, for example a legacy FSX installer, can effectively DESTROY a CFG or XML file if he or it is unaware of the character encoding. Best regards Edited July 2, 20205 yr by Lorby_SI LORBY-SI
July 2, 20205 yr Hi Oliver, Sorry, I searched for "encoding" and didn't even pay attention to the file type. P4AO still gives says the addons.cfg has a wrong encoding, so I can apply the UTF-16 there then. As far as the addon.xml files are concerned, I assume hitting save in P4AO corrects them to UTF-8 BOM automatically, as those that appeared in the earlier listing are now encoded that way. Kind regards, Alan
July 2, 20205 yr Commercial Member 10 minutes ago, AlanB77L said: P4AO still gives says the addons.cfg has a wrong encoding The issue here is not that the encoding is wrong. It is why that happened in the first place. "Something" didn't know what it was doing, and that can come back to bite you. P4AO does not alter files, it always makes a copy of the original and then writes a new one. That is why XML files revert to proper encoding and text declaration when you press "Save". Can't do that for CFG files though, that can go wrong - hence the warning message. When you change the encoding and suddenly you see only jumbled up character garbage, you can just undo the change (as long as you didn't save the file). A program wouldn't care and just proceed. Best regards Edited July 2, 20205 yr by Lorby_SI LORBY-SI
July 2, 20205 yr Thanks for the clarification Oliver. I should check the warnings more often to narrow down the culprit. The addons.cfg should only be written by P3D itself and I assume it would encode it properly. Edited July 2, 20205 yr by AlanB77L Kind regards, Alan
Archived
This topic is now archived and is closed to further replies.