gbif / parsers

Various GBIF parsers for dates, countries, language, taxon ranks, etc
Apache License 2.0
4 stars 8 forks source link

NumberParser uses trim() #7

Open cgendreau opened 7 years ago

cgendreau commented 7 years ago

Java String [trim()](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#trim()) only removes characters with code <= \u0020.

If NumberParser receives a whitespace like \u00A0 (Non-breaking space) the parsing won't work.

Guava's CharMatcher can handle it.

1) We change usage of .tim() and use a CharMatcher 2) We document the limitation of the method and we let the caller handle it.