Open gdey opened 5 years ago
Do you have a WKT string test case for this?
As far as I've read, the spec does not specify any unicode characters, which is why the Decoder
can/does read byte
s and not runes
.
I could add a check to ensure the characters are within a valid ascii range in readByte
We are reading in UTF8 text, the spec does not say that it must be ASCII; so we should not assume ASCII only spaces. The other characters are unlikely to have an issue with UTF8 as they are equivalent, so I did not call it out -- though the errors can be funky.
readWhitespace
assumes all text is ASCII. The function should decode runes correctly and then check to see if they are spaces.Can not test runes this way:
https://github.com/go-spatial/geom/blob/master/encoding/wkt/wkt_decode.go#L55-L57
You need to read all the bytes in the run before testing it.
Here is a test case with the failures: