title: C++ - std::wstring to std::string - quick and dirty conversion for use as key in std::map
body: <p>I'm looking for a bit of advice on the best way to convert a <code>std::wstring</code> to <code>std::string</code> - but a quick and dirty conversion for use as a key in an <code>std::map&lt;std::string, int&gt;</code> object.</p>
  
  <p>The map is quite large, and is already <em>well</em> integrated into the project already, and there are only a handful of keys that require this conversion so I think it will be wasteful to change the map into one that accepts <code>std::wstring</code> as the key.</p>
  
  <p>The output of the conversion doesn't really matter, but it has to be consistent so as to reliably pull the correct values from the map every time.</p>
  
  <p>The application is a Windows only application.</p>
  
  <p>Is there any known process to do a rough conversion reliably for this purpose? Or would the best way be via the usual, proper, conversion process (as described in this SO question/answer: <a href="https://stackoverflow.com/questions/4804298/how-to-convert-wstring-into-string">How to convert wstring into string?</a>)?</p>
  
  <p><strong>Edit:</strong> Please bear in mind - losing information is fine <strong>as long as</strong> things are consistent. i.e. If I throw in some Japanese characters, and they consistently convert into the same (potentially garbage) <code>std::string</code>, that's fine. This will never be for display, only to be used as a key to pull out values from a map.</p>
  
  <p>Thanks!</p>