title: Sort char * With Special (german) Characters?
body: <p>The problem I'm having is that I need to sort a whole bunch of char pointers, but they have special characters. I managed to get a sorting procedure like so:</p>
  
  <pre><code>std::sort(dict_.begin(), dict_.end(), comp);
  
  bool comp(NumPair&amp; a, NumPair&amp; b)
  {
      return boost::lexicographic_compare(a.pFirst, b.pFirst);
  }
  </code></pre>
  
  <p>This worked great, except that all special german characters were sorted before all the others. My teacher (yes, this is pertaining to a homework assignment), however, wants them to be sorted at the end. Awesome!</p>
  
  <p>So I was playing around and thought I could use a trick I saw on a website to enable a regional locale to include the special characters like so</p>
  
  <pre><code>return boost::lexicographic_compare(a.pFirst, b.pFirst, locale("german"));
  </code></pre>
  
  <p>Didn't work! So:</p>
  
  <pre><code>bool comp()
  {
      setlocale(LC_ALL, "");
      return boost::lexicographic_compare(a.pFirst, b.pFirst);
  }
  </code></pre>
  
  <p>Didn't work!</p>
  
  <p>If you have them, I would love to hear some other ideas that might actually work.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>As requested, some sample input and output:</p>
  
  <pre><code>// Some entries
  dict_.push_back( NumPair ( "öffnen", "to open" ) );
  dict_.push_back( NumPair ( "überraschen", "to surprise" ) );
  dict_.push_back( NumPair ( "wünschen", "to wish, to desire, to want" ) );
  dict_.push_back( NumPair ( "widersprechen", "to contradict_" ) );
  
  // NumPair ctor.
  NumPair( const char *pFirst, const char *pSecond )
  {
      /* Deep copy of pFirst and pSecond */
  }
  </code></pre>
  
  <p>Output after result:</p>
  
  <pre><code>öffnen
  überraschen
  wünschen
  widersprechen
  </code></pre>