You must trim security_symbol_ because it cantains unnecessary whitespaces. You can use, for example: boost::trim from <boost/algorithm/string.hpp>