usgs / pdl

Product Distribution Layer
Other
9 stars 17 forks source link

EIDSInputWedge and utf8 files on windows #43

Open jmfee-usgs opened 8 years ago

jmfee-usgs commented 8 years ago

Files with UTF8 characters on windows sometimes generate this exception:

javax.xml.bind.UnmarshalException
 - with linked exception:
[java.io.UTFDataFormatException: Invalid byte 2 of 2-byte UTF-8 sequence.]

A temporary solution is to include the following argument in the java command:

java -Dfile.encoding=utf-8 -jar ProductClient.jar ...
jmfee-usgs commented 8 years ago

This is likely an exception from the eqmessageutils project. One option is to set the encoding using an InputStreamReader interface wrapped around the input stream: https://github.com/usgs/eqmessageutils/blob/master/src/gov/usgs/earthquake/quakeml/Quakeml_1_2_Parser.java#L128