Don't allow '}' in comments

The PGN standard does not allow the '}' character inside a comment,
because it is used to end the comment.

Therefore this character is now replaced with '}' (fullwidth right
curly bracket) when editing comments. This does not look great but is
better than making the PGN data invalid.
This commit is contained in:
Peter Osterlund 2020-04-05 07:16:51 +02:00
parent bd28d178ad
commit 93213f826f

View File

@ -677,8 +677,8 @@ public class DroidChessController {
/** Set comments associated with current position. */
public final synchronized void setComments(CommentInfo commInfo) {
Node cur = game.tree.currentNode;
cur.preComment = commInfo.preComment;
cur.postComment = commInfo.postComment;
cur.preComment = commInfo.preComment.replace('}', '\uff5d');
cur.postComment = commInfo.postComment.replace('}', '\uff5d');
cur.nag = commInfo.nag;
gameTextListener.clear();
updateGUI();