Codings

General feedback and discussion of the game.

Moderator: Forum Moderators

Post Reply
Luc7y
Posts: 19
Joined: June 29th, 2019, 6:19 pm
Contact:

Codings

Post by Luc7y »

While looking by start wesnoth on terminal for debug-informations
with all add-ons runs, I must decode two _main.cfg`s
from utf-8-BOM to utf-8
/data/add-ons/Potato/_main.cfg
and
/data/add-ons/Two_Brothers_Voice/_main.cfg
now the errors was yesterday.
Also the new downloads from the add-ons are with the false codings.
Easy done with gedit - here is coming the chooser for save as with a option for the decodings to use
I copy the complete text on a new textpane in the editor and write over in such cases.
User avatar
The_Gnat
Posts: 2217
Joined: October 10th, 2016, 3:06 am
Contact:

Re: Codings

Post by The_Gnat »

Hello! Thank you for posting this, I am surprised this error has gone un-noticed for so long!

The add-on "Two_Brothers_Voice" is a one that I created. I will re-upload it with a proper utf-8 encoding :)
User avatar
nyov
Posts: 20
Joined: July 7th, 2019, 1:45 pm

Re: Codings

Post by nyov »

Hi. Actually a UTF-8 BOM is a perfectly valid thing for a utf-8 encoded file.
It's perhaps gone unnoticed as the file is still valid utf8 and the addon still works (I didn't test)?
Most editors/parsers just don't expect a UTF-8 BOM and can't handle it, sadly. Removing the BOM is good enough to make it a "proper utf-8 encoding".
https://unicodebook.readthedocs.io/unicode_encodings.html#byte-order-marks-bom wrote: Some Windows applications, like notepad.exe, use UTF-8 BOM, whereas many applications are unable to detect the BOM, and so the BOM causes trouble. UTF-8 BOM should not be used for better interoperability.
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Codings

Post by josteph »

@nyov You're right about UTF-8 BOM being valid UTF-8, of course. The thing is, wesnoth warns about BOMs when it encounters them: error config: Skipping over a utf8 BOM at foo.cfg:1. I don't know what the purpose of that warning is. Maybe it can be removed.
Post Reply