Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Quotation mark in PGN headers

Author: Miguel A. Ballicora

Date: 06:47:12 02/02/03

Go up one level in this thread


On February 01, 2003 at 18:51:55, Dieter Buerssner wrote:

>I wonder, if the following PGN headers are correct

Very opportunistic reading CCC from my part! I was facing this problem
yesterday!

>[Event "Computer chess game 5' + 3""]
>(Typical Chessbase generated header)
>
>[Event "1& A (Pryca Gij\"]
>(Generated by Scid from a large database)
>
>I would think, that the correct way to write this would be
>
>[Event "Computer chess game 5' + 3\""]
>
>and
>
>[Event "1& A (Pryca Gij\\"]

>But it is a fact, that the above headers happen. I wonder, how PGN parsing
>software, that wants to be not too picky, and makes the best of what it sees,
>should do in those cases. I can see myself, that looking at the next char can
>help in those specific cases, but it may introduce other errors for correct PGN.

PGN Standard says:

"A string token is a sequence of zero or more printing characters delimited by a
pair of quote characters (ASCII decimal value 34, hexadecimal value 0x22). An
empty string is represented by two adjacent quotes. (Note: an apostrophe is not
a quote.) A quote inside a string is represented by the backslash immediately
followed by a quote. A backslash inside a string is represented by two adjacent
backslashes. Strings are commonly used as tag pair values (see below).
Non-printing characters like newline and tab are not permitted inside of
strings. A string token is terminated by its closing quote. Currently, a string
is limited to a maximum of 255 characters of data."

So you are right about what it should be used.

I think that we could take advantage of the fact that a newline cannot be inside
a string to at least make sure other tags (or a game) are not ignored and avoid
worse problems. That is what happened to me.
I just ignore all the tags in the "quick and dirty" parser of mine to build the
opening book but I was bitten badly by this problem. I am glad that the parser
warns when it sees problems. It saw dozens, but actually it was the first wrong
" that threw everything out of whack.

I do not know what is the best solution, but I thinking about it :-)

Miguel






>How do other authors cope with this?
>
>Regards,
>Dieter



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.