Add Windows-specific documentation to handle unicode characters
Internal and external users building/running nshmp-haz on Windows machines have reported that the code crashes on example 7 (disaggregation), when running in a Windows environment (command prompt, power shell, GitBash, but not WSL v1 or v2?) with a java.lan.IllegalArgumentException: Invalid ? [0.0] error
(full exception at the bottom). This happens when the 3D interval table is built even though the calc config fully defines non-zero default values for the disag parameters. The disag configuration echoed to the console shows "?" instead of Δ and ε characters. The java compiler can handle unicode in the code but not when the program is run and input files are opened on Windows systems.
The following work around needs to be documented in the software documentation and the example file READMEs:
Add -Dfile.encoding="UTF-8"
to the java call. For example add this to at least the disaggregation alias:
alias disagg='java -Xms4g -Xmx8g -Dfile.encoding="UTF-8" -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.DisaggCalc'
Also see #556 (closed)
Error message:
DisaggCalc: error
Arguments: [C:/Users/name/nshmTest/nshm-conus-5.3.0/nshm-conus-5.3.0, sites.csv, config.json]
java.lang.IllegalArgumentException: Invalid ? [0.0]
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:220)
at gov.usgs.earthquake.nshmp.data.DoubleData.checkDelta(DoubleData.java:802)
at gov.usgs.earthquake.nshmp.data.IntervalData.keys(IntervalData.java:42)
at gov.usgs.earthquake.nshmp.data.IntervalVolume$Builder.rows(IntervalVolume.java:350)
at gov.usgs.earthquake.nshmp.calc.DisaggDataset$AbstractBuilder.<init>(DisaggDataset.java:227)
at gov.usgs.earthquake.nshmp.calc.DisaggDataset$Builder.<init>(DisaggDataset.java:281)
at gov.usgs.earthquake.nshmp.calc.DisaggDataset.builder(DisaggDataset.java:198)
at gov.usgs.earthquake.nshmp.calc.DisaggDataset.builder(DisaggDataset.java:170)
at gov.usgs.earthquake.nshmp.calc.DisaggConfig.builder(DisaggConfig.java:83)
at gov.usgs.earthquake.nshmp.calc.Disaggregation.atImls(Disaggregation.java:112)
at gov.usgs.earthquake.nshmp.DisaggCalc.calcRp(DisaggCalc.java:309)
at gov.usgs.earthquake.nshmp.DisaggCalc.run(DisaggCalc.java:191)
at gov.usgs.earthquake.nshmp.DisaggCalc.main(DisaggCalc.java:107)