bhlangonijr / chesslib

chess library for legal move generation, FEN/PGN parsing and more
Apache License 2.0
223 stars 78 forks source link

Issues with test cases in UTF-8 #50

Closed dlbbld closed 3 years ago

dlbbld commented 3 years ago

In the test/resources folder there are exactly two PGN stored as UTF-8, "Morphy_UTF8.pgn" and "redqueen.pgn". I found that the corresponding test cases PgnHolderTest.testPGNLoad4 and PgnHolderTest.testUtf8 sometimes work and sometimes not. Encoding related, this problem is probably not caused by the project. I found that when running the JUnit tests on the project, it sometimes worked, sometimes not. Same for pom.xml. I use Eclipse under Windows; the chesslib project text file encoding is UTF-8.s

When it does not work, the project does not build, so it is worth having a look here.

dlbbld commented 3 years ago

Is there some feedback on this? I don't actually know the reason why UTF-8 must be supported. The PGN specification says otherwise:

PGN data is represented using a subset of the eight bit ISO 8859/1 (Latin 1) character set.

I can think of some reason when using comments in different languages by today, but I don't know an example. Can you specify a use case which requires UTF-8 support? For this not being able to build the project (sometimes) is a bit clumsy to work around. A bit attention here wouldn't harm.

bhlangonijr commented 3 years ago

Can't reproduce so far....

dlbbld commented 3 years ago

Closing the issue as it became stale.