problem with a string's format in c++ while doing tcp communication
<p>i am building a simple c++ client, i am splitting the info i get from the server to frames, and pass each frame to a function that processes it, i split the frame into lines using</p>

<pre><code>Poco::StringTokenizer tokenizer(frame, "\n");
</code></pre>

<p>i take the first line of the tokenizer which represents the type of frame</p>

<pre><code> StmpCommand command(tokenizer[0]);
</code></pre>

<p>a StmpCommand is an enum with the different types of messages
and the constructor works as follows :</p>

<pre><code>StmpCommand(std::string command): commandType_() {
  bool x=command=="CONNECTED";
  std::cout&lt;&lt;x&lt;&lt;std::endl;
  if ("SUBSCRIBE" == command)
   commandType_ =  SUBSCRIBE;
  else if ("UNSUBSCRIBE" == command)
   commandType_ =  UNSUBSCRIBE;
  else if ("SEND" == command)
   commandType_ =  SEND;
  else if ("BEGIN" == command)
   commandType_ =  BEGIN;
  else if ("COMMIT" == command)
   commandType_ =  COMMIT;
  else if ("CONNECT" == command)
   commandType_ =  CONNECT;
  else if ("MESSAGE" == command)
   commandType_ =  MESSAGE;
  else if ("RECEIPT" == command)
   commandType_ =  RECEIPT;
  else if ("CONNECTED" == command)
   commandType_ =  CONNECTED;
  else if ("DISCONNECT" == command)
   commandType_ =  DISCONNECT;
  else if ("ERROR" == command)
   commandType_ =  ERROR;
  else {
   std::cerr&lt;&lt;"Error in building StmpCommand object, unknown type - "&lt;&lt;command&lt;&lt;std::endl;
  }
 }
</code></pre>

<p>the first frame i am trying to proccess is a CONNECTED frame
therefor i try to create a StmpCommand with CONNECTED as the constructor's only argument
and for some reason i am getting an :</p>

<pre><code>Error in building StmpCommand object, unknown type - �CONNECTED
</code></pre>

<p>i am clearly passing a string containing CONNECTED but i'm guessing there is something else there that isn't allowing the condition else if ("CONNECTED" == command) to hap</p>
