- Blind mode tutorial
lichess.org
Donate

Error when importing PGN from chess.com

When I try to import games from chess.com to analyze, it sometimes fails (but sometimes works).

Steps to reproduce:

  1. Go to this game on chess.com: https://www.chess.com/analysis/game/live/23131302937?tab=analysis
  2. Click on download, and copy the PGN (option with computer analysis).
  3. Paste PGN into lichess analysis page.
  4. Server responds with error 400.

The operation succeeds if I choose the "Annotation" PGN option on chess.com, only fails with the "Computer Analysis" option.

When I try to import games from chess.com to analyze, it sometimes fails (but sometimes works). Steps to reproduce: 1. Go to this game on chess.com: https://www.chess.com/analysis/game/live/23131302937?tab=analysis 2. Click on download, and copy the PGN (option with computer analysis). 3. Paste PGN into lichess analysis page. 4. Server responds with error 400. The operation succeeds if I choose the "Annotation" PGN option on chess.com, only fails with the "Computer Analysis" option.

talk about this on chess.com, not lichess

talk about this on chess.com, not lichess

Can you try to paste the PGN to anywhere else(chess.com for example)? Maybe the PGN itself is invalid.

Can you try to paste the PGN to anywhere else(chess.com for example)? Maybe the PGN itself is invalid.

Chesscom's pgn includes the □ symbol (unicode U+25A1) to annotate forced moves. That symbol is causing the problem.

Reference: https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs

Chesscom's pgn includes the □ symbol (unicode U+25A1) to annotate forced moves. That symbol is causing the problem. Reference: https://en.wikipedia.org/wiki/Numeric_Annotation_Glyphs

@XinghanChen said in #3:

Can you try to paste the PGN to anywhere else(chess.com for example)? Maybe the PGN itself is invalid.
The PGN loads correctly on chess.com. I'll try reporting the bug there.

@XinghanChen said in #3: > Can you try to paste the PGN to anywhere else(chess.com for example)? Maybe the PGN itself is invalid. The PGN loads correctly on chess.com. I'll try reporting the bug there.

If you want to get a valid PGN for that game you can download it from here:

https://www.chess.com/game/live/23131302937?username=luckyt94

That link is found by going to your account https://www.chess.com/member/luckyt94 and then clicking on, for this game, the plus sign.

If you want to get a valid PGN for that game you can download it from here: https://www.chess.com/game/live/23131302937?username=luckyt94 That link is found by going to your account https://www.chess.com/member/luckyt94 and then clicking on, for this game, the plus sign.

There's nothing wrong with the pgn per se. Chess.com isn't bugged. The pgn includes a rare special character that chess.com understands but Lichess does not. To help Lichess understand the pgn, you'd currently need to remove the two □ symbols that it contains.

There's nothing wrong with the pgn per se. Chess.com isn't bugged. The pgn includes a rare special character that chess.com understands but Lichess does not. To help Lichess understand the pgn, you'd currently need to remove the two □ symbols that it contains.

The issue is not the symbol itself but that chess.com adds a space between the move and the annotation. If you remove the spaces and try to import the PGN in a study (where annotations are actually preserved), you'll see that it works just fine and recognizes the annotation.

I'm not too well versed in the details of PGNs but this seems like a bug on chess.com's side. They probably shouldn't insert spaces at that point. They don't do it for other annotations either.

The issue is not the symbol itself but that chess.com adds a space between the move and the annotation. If you remove the spaces and try to import the PGN in a study (where annotations are actually preserved), you'll see that it works just fine and recognizes the annotation. I'm not too well versed in the details of PGNs but this seems like a bug on chess.com's side. They probably shouldn't insert spaces at that point. They don't do it for other annotations either.

This topic has been archived and can no longer be replied to.