Error on bad encoding in weather file

Issue #23 resolved
Peter Ellis created an issue

Selecting a weather file with the Browse button in the Run Simulation dialog, generates an error message if the weather file has any bad character encodings (non UTF-8). Euclid should catch encoding problems and handle them gracefully, not crash.

For example, the ã character in São Paulo in the attached weather file has a bad encoding.

ERROR:
ArgumentError
invalid byte sequence in UTF-8

BACKTRACE:
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/WeatherFile.rb:33:in `split'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/WeatherFile.rb:33:in `parse_header'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/WeatherFile.rb:18:in `initialize'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/dialogs/RunSimulationDialog.rb:95:in `new'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/dialogs/RunSimulationDialog.rb:95:in `show_weather_file_info'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/dialogs/RunSimulationDialog.rb:87:in `on_browse'
C:/Projects/Euclid/euclid-master~/build/output/extension/euclid/lib/legacy_openstudio/lib/dialogs/RunSimulationDialog.rb:27:in `block in add_callbacks'
SketchUp:1:in `call'

CONFIGURATION:
Euclid 0.9.4
SketchUp 17.2.2555 64-bit
Ruby 2.2.4 x64-mingw32

Comments (1)

  1. Log in to comment