File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ A key can have multiple values associated with it. For example:
53
53
54
54
Here ` AB ` (add black) is used to add three black stones to the board.
55
55
56
+ According the the SGF specification ` \ ` is the escape character. When ` \ ` is
57
+ encountered during parsing, it indicates that the following character should be
58
+ printed as is. The exception to this is whitespace, with newline, carriage
59
+ return and tab encoded as ` "\n" ` , ` "\r" ` and ` "\t" ` respectively. When parsing
60
+ you can expect some characters to _ always_ be escaped, including parentheses,
61
+ square brackets, semicolons and colons.
62
+
63
+ When parsing SGF files whitespace gets special handling, with the exception of
64
+ newlines any whitespace character encountered is replaced with a single space
65
+ character irrespective of if the original character is found in its escaped
66
+ from or its unescaped from.
67
+
56
68
There are a few more complexities to SGF (and parsing in general), which
57
69
you can mostly ignore. You should assume that the input is encoded in
58
70
UTF-8, the tests won't contain a charset property, so don't worry about
You can’t perform that action at this time.
0 commit comments