PGN for dummies

Discussion of chess software programming and technical issues.

Moderator: Ras

tcusr
Posts: 325
Joined: Tue Aug 31, 2021 10:32 pm
Full name: tcusr

Re: PGN for dummies

Post by tcusr »

Fulvio wrote: Sat Nov 20, 2021 4:29 pm - Windows 10 is crap
where's the fake news?
R. Tomasi
Posts: 307
Joined: Wed Sep 01, 2021 4:08 pm
Location: Germany
Full name: Roland Tomasi

Re: PGN for dummies

Post by R. Tomasi »

Hm... not sure how helpful a discussion about Windows 7 vs. Windows 10 in the context of this thread. Discussions of that kind fall into the same category as discussions à la "Programming language X is superior than language Y". My strong advice would however be to not rely on an OS that has been deprecated for many years and actually discontinued for almost as many years. Not receiving security fixes seems to be a very risky decision to me. Now while we're at it, I might as well give my two cents, though: Windows 7 was a great OS, whereas Windows 8 was a total abomination. Windows 10 however really is good (by the same standards as Win7): it's stable, it's performant and (to my great pleasure) got rid of all the eye-candy. It's a very lean and "to-the-point" UI. This being said, there's a brand new version of Windows out, Windows 11. I have installed it on a few of my machines over the last couple of days and for me the jury is still out on it. There do not seem to be many (are there some, actually?) fundamental changes compared to Win10, except for some of the eye-candy being back in different clothings :roll:

Back on topic, though: I would think that the whole discussion about UTF-8 vs. Latin-1 is kind of academic. If a generator sticks to the recommendation of the standard (i.e. not using certain character ranges) the resulting file should be almost (if not exactly) the same, at least if we're not talking chinese names and comments (and similar stuff). Personally I would like to see the standard amended to support UTF-8, but certainly not at the price of breaking compatibility. Problems arising on an OS that is outdated for over 10 years now should not be a concern for people programming new software with PGN support. I care about that as much as I care about PGN files being properly displayed on an old Apple II.

Just deciding to interpret some parts of the standard as void, or disregarding that the standard actually does require Latin-1 (and not UTF-8) seems to me a dangerous road to go. There is no point in having a standard when people just ignore it as they see fit. So, irrespective of whether I can display the files in notepad, or whether some new software uses UTF-8 for PGN files, what really matters to me is what the actual standard says. From my understanding it is quite explicit on both issues: don't use UTF-8, and stick with the UNIX newline conventions when generating PGNs for archival purposes.
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN for dummies

Post by hgm »

Fulvio wrote: Sat Nov 20, 2021 4:29 pm
hgm wrote: Sat Nov 20, 2021 3:59 pm Only one spreading fake news here seems to be you...
Your fake news:
- the PGN standard admit only ASCII chars
- UTF-8 or LF-only lines would make it a binary format.
- Windows cannot handle a UTF-8 text file without the Byte Order Mark
- Notepad cannot read LF-only text files
- Windows 10 is crap

What would mine be?
Pretty much the opposit of the points above. Because my NotePad does not handle LF-only text files (fact). Insisting on a particular encoding that is not a valid text format on another computer does make it a binary standard (by definition). My WordPad does not correctly display UTF-8 encoded files without BOM (shown in screenshot). No matter how often or loud you claim the contrary, the facts won't go away.

It is not even clear what the purpose of this discussion is, as you seem to have no point in the first place. All I said is that requiring an encoding that is alien to an OS can only cause problems, and when a standard tries to exceed its jurisdiction by requiring one, it had better be ignored. Which is exactly what you do, by using UTF-8 where the standard prescribes Latin-1.
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Re: PGN for dummies

Post by Fulvio »

hgm wrote: Sat Nov 20, 2021 4:50 pm It is not even clear what the purpose of this discussion is, as you seem to have no point in the first place.
The point is that a portable text file should be able to be viewed and edited independently of the computer or operating system.

While your idiotic thesis is that a PGN file should be encoded according to the operating system it is created on.
So it could be UTF-8, Latin-1, Latin-2, EUC-JP, whatever.

It is worth pointing out that the reason you hold this absurd thesis is simply that Winboard behaves this way and it annoys you to fix it. Even if it means that Winboard cannot read a PGN created on a different OS.
Fine, no problem.
Just stop making up things to convince yourself that it's the best solution.
R. Tomasi
Posts: 307
Joined: Wed Sep 01, 2021 4:08 pm
Location: Germany
Full name: Roland Tomasi

Re: PGN for dummies

Post by R. Tomasi »

Just an idea: the standard allows for custom tags. It is also very explicit on the fact that tag names should not use any characters that aren't printable in 7-bit ASCII. It should be easy to just introduce a new tag ("Encoding") which would allow to specify the codepage used for comments and annotations. That way the reading software would have a way to know which codepage to use when displaying comments, and all the rest of the PGN files, where you actually never need anything beyond 7-bit ASCII would remain the same.

The newline problems would not be solved by that, though.
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN for dummies

Post by hgm »

Fulvio wrote: Sat Nov 20, 2021 5:13 pm
hgm wrote: Sat Nov 20, 2021 4:50 pm It is not even clear what the purpose of this discussion is, as you seem to have no point in the first place.
The point is that a portable text file should be able to be viewed and edited independently of the computer or operating system.

While your idiotic thesis is that a PGN file should be encoded according to the operating system it is created on.
So it could be UTF-8, Latin-1, Latin-2, EUC-JP, whatever.

It is worth pointing out that the reason you hold this absurd thesis is simply that Winboard behaves this way and it annoys you to fix it. Even if it means that Winboard cannot read a PGN created on a different OS.
Fine, no problem.
Just stop making up things to convince yourself that it's the best solution.
The only idiotic idea here is that this would be possible. I have already shown that it is definitely not the case for your standards-violating 'PGN' files on my computer with my operating system.

But I think you made it clear what your purpose is; this has nothing to do with PGN, but you just try to create and grab an opportunity for WinBoard bashing. What you apparently fail to understand (or willfully ignore) is that the things you blame WinBoard for not reading are not PGN files at all. If you had wanted to say something sensible, you could have blamed XBoard for not correctly displaying some non-ascii names and comments in true PGN, and using UTF-8 when writing them. But of course you don't want to do that, because SCID does the same. :lol:
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Re: PGN for dummies

Post by Fulvio »

hgm wrote: Sat Nov 20, 2021 6:47 pm If you had wanted to say something sensible, you could have blamed XBoard for not correctly displaying some non-ascii names and comments in true PGN, and using UTF-8 when writing them. But of course you don't want to do that, because SCID does the same. :lol:
Another fake news: obviously SCID shows correctly non-ascii names and comments in "true" PGN.
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN for dummies

Post by hgm »

Well, that is just to repay you for the fake news that it would annoy me to fix WinBoard, then.

Why should WinBoard be able to read a nonsense format created by you? If you would have stuck to the standard of using Latin-1 encoding on other OS, it would have no problem at all reading it. You are obviously at fault here, not WinBoard.
Fulvio
Posts: 396
Joined: Fri Aug 12, 2016 8:43 pm

Re: PGN for dummies

Post by Fulvio »

hgm wrote: Sat Nov 20, 2021 7:41 pm If you would have stuck to the standard of using Latin-1 encoding on other OS, it would have no problem at all reading it.
Another fake news: I just tried xboard on Ubuntu and it is not able to read Latin-1 encoded comments. And I suppose it would be the same on every computer where the locale is not Latin-1, even Windows.
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: PGN for dummies

Post by hgm »

And again it is you spreading the fake news. I never said that XBoard would be able to read Latin-1 encoding. That is a fabrication by you.

As I explaned, I consider any requirements on the encoding in the definition of a text format void. Linux dictates that text should be encoded as UTF-8, and XBoard bends to that standard.