Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

TL;DR: you have a hidden character at the start of your file. I removed the hidden UTF-8 BOM at the start of your file: https://gist.github.com/jmarrec/ddd3048656e8391c2ddcbf09b58b96c7

(You still have problems with the weather file, but that's something else).


Goddamn encoding problems. You could look at them all day and you won't find the goddamn problem.

Well so, I built E+ in Debug mode, and used a debugger to step through the code at the guilty part, and here https://github.com/NREL/EnergyPlus/blob/de5717264117424151ea2838f8d1c323365d99cc/src/EnergyPlus/WeatherManager.cc#L4329-L4331

(lldb) p Header(HdLine)
(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $22 = "LOCATION"
(lldb) p Line.data
(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $23 = "LOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0"

yet HdPos ends up being 3? WHAAT? It finds "LOCATION" but only at the 3rd char?

Annnnnnnnnnnd here we are, here's what we get when we use python to read your site_4_.epw file in binary mode:

In [1]: with open('site_4_.epw', 'rb') as f:
   ...:     content = f.read()
   ...: print(content.splitlines()[0])
b'\xef\xbb\xbfLOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0'

See that goddamn \xef\xbb\xbf? That's called an UTF-8 BOM and apparently you have one at the beginning of your file.

(The only reason I know where to look for that stuff is because I've been bit by it waaaaay too many times, looking at you you awful "non-breaking space").

TL;DR: you have a hidden character at the start of your file. I removed the hidden UTF-8 BOM at the start of your file: https://gist.github.com/jmarrec/ddd3048656e8391c2ddcbf09b58b96c7

(You still have problems with the weather file, but that's something else).


Goddamn Stupid encoding problems. You could look at them all day and you won't find the goddamn problem.

Well so, I built E+ in Debug mode, and used a debugger to step through the code at the guilty part, and here https://github.com/NREL/EnergyPlus/blob/de5717264117424151ea2838f8d1c323365d99cc/src/EnergyPlus/WeatherManager.cc#L4329-L4331

(lldb) p Header(HdLine)
(const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $22 = "LOCATION"
(lldb) p Line.data
(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) $23 = "LOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0"

yet HdPos ends up being 3? WHAAT? It finds "LOCATION" but only at the 3rd char?

Annnnnnnnnnnd here we are, here's what we get when we use python to read your site_4_.epw file in binary mode:

In [1]: with open('site_4_.epw', 'rb') as f:
   ...:     content = f.read()
   ...: print(content.splitlines()[0])
b'\xef\xbb\xbfLOCATION,Anderson County Ap,SC,USA,TMY3,723125,34.50,-82.72,-5.0,232.0'

See that goddamn annoying \xef\xbb\xbf? That's called an UTF-8 BOM and apparently you have one at the beginning of your file.

(The only reason I know where to look for that stuff is because I've been bit by it waaaaay too many times, looking at you you awful "non-breaking space").