[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: [tor-bugs] #14859 [Onionoo]: Adapt Onionoo's parsing code for MaxMind's GeoLite2 City files to their new format
#14859: Adapt Onionoo's parsing code for MaxMind's GeoLite2 City files to their new
format
-------------------------+-----------------
Reporter: karsten | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: Onionoo | Version:
Resolution: | Keywords:
Actual Points: | Parent ID:
Points: |
-------------------------+-----------------
Comment (by iwakeh):
Of course, you're right, this is not a test, but a run-time verification.
Using {{{InputStreamReader(InputStream in, CharsetDecoder dec)}}} for
reading the files
will throw {{{CharacterCodingException}}}, e.g.
{{{
BufferedReader br = new BufferedReader(new InputStreamReader(
new FileInputStream(this.geoLite2CityBlocksIPv4CsvFile),
StandardCharsets.UTF_8.newDecoder));
}}}
The mentioned classes are from 'java.nio.charset'
A {{{CharacterCodingException}}} could exit the run, or trigger a warning
and
use the current way of reading the file as fallback, which could lead to
mangled
output. Or, just not use the wrongly encoded file, like in the missing-
geoip-case.
The latter seems best to me.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/14859#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs