<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[std::locale wirt exception]]></title><description><![CDATA[<p>Hi!</p>
<p>Habe ein (mehr oder weniger wichtiges <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> ) Problem mit den C++ Locals, denn folgender Code will einfach nicht funktionieren (obwohl ich schon das halbe internet zu gültigen &quot;Codes&quot; durchforstet hab'):</p>
<pre><code class="language-cpp">std::locale(&quot;German&quot;);
</code></pre>
<p>Der Code muss eigentlich funktionieren. Früher hat er das (obwohl ich vielleicht einen anderen Code benutzt habe... an den ich mich nicht erinnere). Was ist da falsch?</p>
<p>VD</p>
<p>P.S.: Das &quot;nicht funktionieren&quot; heißt, dass die übliche exception geschmissen wird (dass der Name nicht erkannt wird).</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/301373/std-locale-wirt-exception</link><generator>RSS for Node</generator><lastBuildDate>Tue, 11 Aug 2026 19:25:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/301373.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 25 Mar 2012 16:02:01 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:02:44 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Habe ein (mehr oder weniger wichtiges <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> ) Problem mit den C++ Locals, denn folgender Code will einfach nicht funktionieren (obwohl ich schon das halbe internet zu gültigen &quot;Codes&quot; durchforstet hab'):</p>
<pre><code class="language-cpp">std::locale(&quot;German&quot;);
</code></pre>
<p>Der Code muss eigentlich funktionieren. Früher hat er das (obwohl ich vielleicht einen anderen Code benutzt habe... an den ich mich nicht erinnere). Was ist da falsch?</p>
<p>VD</p>
<p>P.S.: Das &quot;nicht funktionieren&quot; heißt, dass die übliche exception geschmissen wird (dass der Name nicht erkannt wird).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195277</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:02:44 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:05:39 GMT]]></title><description><![CDATA[<p>trololol<br />
google it</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195281</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:05:39 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:06:29 GMT]]></title><description><![CDATA[<p>Die Namen für die locales sind leider stark plattformanhängig. Vermutlich ist der Name für die Plattform auf der Du testest einfach falsch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195282</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195282</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:06:29 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:06:43 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/263858" rel="nofollow">http://www.c-plusplus.net/forum/263858</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195283</guid><dc:creator><![CDATA[vario-500]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:06:43 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:14:21 GMT]]></title><description><![CDATA[<p>vario-500 schrieb:</p>
<blockquote>
<p><a href="http://www.c-plusplus.net/forum/263858" rel="nofollow">http://www.c-plusplus.net/forum/263858</a></p>
</blockquote>
<p>Kenn ich schon. War ich schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195288</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195288</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:14:21 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:15:06 GMT]]></title><description><![CDATA[<p>Tachyon schrieb:</p>
<blockquote>
<p>Die Namen für die locales sind leider stark plattformanhängig. Vermutlich ist der Name für die Plattform auf der Du testest einfach falsch.</p>
</blockquote>
<p>Ich &quot;teste&quot; auf Windows 7. Gibt es keinen Konsolen-Befehl zum auflisten aller gültiger Namen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195289</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:15:06 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Sun, 25 Mar 2012 16:18:07 GMT]]></title><description><![CDATA[<p>314159265358979 schrieb:</p>
<blockquote>
<p>trololol<br />
google it</p>
</blockquote>
<p><s>Hab ich doch! Ist praktisch Zeitverschwendung!</s></p>
<p>Edit: Nein, doch nicht. Aber trotzdem.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195291</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 25 Mar 2012 16:18:07 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 14:24:26 GMT]]></title><description><![CDATA[<p>*push* Bitte nicht ignorieren. Nach einer Weile herumsuchens bin ich auf nichts gestoßen. Kennt ihr nicht vielleicht ein paar Seiten oder so? Welche benutzt ihr? Der Standard ist leider auch schweigend. Und nach mehr als 20 Herumprobierereien hab ich auch keinen Bock mehr.</p>
<p>Es kann doch nicht sein, dass ich jetzt keine Locals mehr benutzten kann!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195576</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195576</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 14:24:26 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 14:26:47 GMT]]></title><description><![CDATA[<p>Die Lösung wurde doch schon genannt: Benutze den compilerspezifischen String.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195578</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Mon, 26 Mar 2012 14:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 14:28:48 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p>Die Lösung wurde doch schon genannt: Benutze den compilerspezifischen String.</p>
</blockquote>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> ! Aber wo wurde die denn genannt? Im anderen Link?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195579</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195579</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 14:28:48 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 14:50:08 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Michael E. schrieb:</p>
<blockquote>
<p>Die Lösung wurde doch schon genannt: Benutze den compilerspezifischen String.</p>
</blockquote>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> ! Aber wo wurde die denn genannt? Im anderen Link?</p>
</blockquote>
<p>Also compilerspezifisch ist nicht ganz richtig, eher plattformspezifisch. Plattformunabhängig sind nur die locales &quot;C&quot; (im Prinzip US-Englisch) und &quot;&quot; (die Systemlocale). Die anderen musst du eben nachschlagen. Wobei ich noch nie den Grund verstanden habe, wieso man etwas anderes nehmen sollte als &quot;&quot; (oder &quot;C&quot;), denn ich will nicht, dass ein Programm plötzlich eine ungewöhnte Locale benutzt, bloß weil es von einem Deutschen programmiert wurde. Da ist doch der ganze Sinn von Loacales futsch, wenn das Programm nicht die Systemlocale (und damit <strong>meine</strong> Sprache) benutzt (oder wenn es sein muss die Standardlocale), sondern die Sprache des Programmierers. Wieso hätte mich als Nutzer zu interessieren, wie der Programmierer in der Schule seine Dezimaltrennzeichen geschrieben hat? Oder noch schlimmer wird's wenn das Programm noch einen andere Zeichensatz erzwingt als den meiner Ausführungsumgebung. Ich wüsste nicht einmal aus dem Kopf, wie ich in meiner Konsole ein UTF-32 Zeichen tippen kann.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195589</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 26 Mar 2012 14:50:08 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 14:53:08 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<p>Michael E. schrieb:</p>
<blockquote>
<p>Die Lösung wurde doch schon genannt: Benutze den compilerspezifischen String.</p>
</blockquote>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> ! Aber wo wurde die denn genannt? Im anderen Link?</p>
</blockquote>
<p>Also compilerspezifisch ist nicht ganz richtig, eher plattformspezifisch. Plattformunabhängig sind nur die locales &quot;C&quot; (im Prinzip US-Englisch) und ....</p>
</blockquote>
<p>Naja, jedenfalls funktioniert das &quot;Programm&quot; mit der system-lokale auch nicht - und wenn man dann (deiner Argumentation folgend) keine anderen nehmen sollte, hat man ja keine Wahl, als toupper, bzw. tolower selbst zu implementieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195591</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195591</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 14:53:08 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 15:01:53 GMT]]></title><description><![CDATA[<p>So so! es funktioniert also nicht. Lies dir doch bitte mal den ersten Link in meiner Signatur gründlich durch und stell dann noch einmal eine brauchbare Frage.</p>
<p>(Dass ich das mal bei jemandem mit 1500 Beiträgen schreiben muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> )</p>
<p>P.S.: Du sagst also, dass<br />
<a href="http://ideone.com/jbkvZ" rel="nofollow">http://ideone.com/jbkvZ</a><br />
bei dir eine Exception wirft?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195594</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195594</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 26 Mar 2012 15:01:53 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 15:01:37 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>So so! es funktioniert also nicht. Lies dir doch bitte mal den ersten Link in meiner Signatur gründlich durch und stell dann noch einmal eine brauchbare Frage.</p>
<p>(Dass ich das mal bei jemandem mit 1500 Beiträgen schreiben muss <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> )</p>
</blockquote>
<p>Ok.</p>
<p>Nein, es funktioniert nicht, da es einfach Umlaute ignoriert (was Michael E. furchtbar blöd findet - und ich auch). Das sollte es aber nicht, wenn das globale locale auf German gesetzt wurde. Also? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195595</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195595</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 15:01:37 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 15:02:57 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Nein, es funktioniert nicht, da es einfach Umlaute ignoriert (was Michael E. furchtbar blöd findet - und ich auch). Das sollte es aber nicht, wenn das globale locale auf German gesetzt wurde. Also? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
</blockquote>
<p>So so! &quot;Es&quot; &quot;ignoriert&quot; Umlaute. Dann ist ja jetzt alles klar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195596</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 26 Mar 2012 15:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 15:13:46 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<p>Nein, es funktioniert nicht, da es einfach Umlaute ignoriert (was Michael E. furchtbar blöd findet - und ich auch). Das sollte es aber nicht, wenn das globale locale auf German gesetzt wurde. Also? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
</blockquote>
<p>So so! &quot;Es&quot; &quot;ignoriert&quot; Umlaute. Dann ist ja jetzt alles klar.</p>
</blockquote>
<p>Kennst du den anderen Thread nicht?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;string&gt;

void firstToupperOtherTolower(std::string&amp; str)
{
      if(str.length())
            str.at(0) = toupper(str.at(0));

      for(std::string::size_type a(1);a &lt; str.length();++a)
            str.at(a) = tolower(str.at(a));
}

int main()
{
      std::locale::global(std::locale(&quot;&quot;));

      std::string vorname, nachname;
      std::cout &lt;&lt; &quot;Bitte Vornamen eingeben: &quot;;
      std::getline(std::cin, vorname);///PI zuliebe
      std::cout &lt;&lt; &quot;Bitte Nachnamen eingeben: &quot;;
      std::getline(std::cin, nachname);

      firstToupperOtherTolower(nachname);
      firstToupperOtherTolower(vorname);

      std::cout &lt;&lt; &quot;Ihr Name ist &quot; &lt;&lt; vorname &lt;&lt; ' ' &lt;&lt; nachname &lt;&lt; '\n';
}
</code></pre>
<p>Eingabe: oNI oNI Ausgabe: Oni Oni<br />
Eingabe: öLÄ öNÜ Ausgabe: ölÄ önÜ</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195600</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 15:13:46 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 15:28:15 GMT]]></title><description><![CDATA[<p><a href="http://www.cplusplus.com/reference/std/locale/ctype/tolower/" rel="nofollow">http://www.cplusplus.com/reference/std/locale/ctype/tolower/</a><br />
<a href="http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ" rel="nofollow">http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195603</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Mon, 26 Mar 2012 15:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 16:09:39 GMT]]></title><description><![CDATA[<p>Michael E. schrieb:</p>
<blockquote>
<p><a href="http://www.cplusplus.com/reference/std/locale/ctype/tolower/" rel="nofollow">http://www.cplusplus.com/reference/std/locale/ctype/tolower/</a><br />
<a href="http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ" rel="nofollow">http://fara.cs.uni-potsdam.de/~kaufmann/?page=GenCppFaqs&amp;faq=stricmp#Answ</a></p>
</blockquote>
<p>Erstes Kenn ich (natürlich) schon, zweites hat mit meine<s>r Frage</s>m Problem nichts zu tun (strings case-insensitive vergleichen!?) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195614</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195614</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 16:09:39 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 16:13:13 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::getline(std::cin, vorname);///PI zuliebe
</code></pre>
</blockquote>
<p>wat</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195617</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195617</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Mon, 26 Mar 2012 16:13:13 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 16:14:57 GMT]]></title><description><![CDATA[<p>314159265358979 schrieb:</p>
<blockquote>
<p>Hacker schrieb:</p>
<blockquote>
<pre><code class="language-cpp">std::getline(std::cin, vorname);///PI zuliebe
</code></pre>
</blockquote>
<p>wat</p>
</blockquote>
<p>Hattest dich doch letztens mit Werner Salomon gezofft? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195618</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 16:14:57 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 16:16:01 GMT]]></title><description><![CDATA[<p>ney.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195619</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Mon, 26 Mar 2012 16:16:01 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 16:18:28 GMT]]></title><description><![CDATA[<p>Hacker schrieb:</p>
<blockquote>
<p>Erstes Kenn ich (natürlich) schon,</p>
</blockquote>
<p>Warum benutzt du es dann nicht?</p>
<blockquote>
<p>zweites hat mit meine<s>r Frage</s>m Problem nichts zu tun (strings case-insensitive vergleichen!?) <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
</blockquote>
<p>Es würde helfen, wenn du dir das mal durchliest, statt schon vorher zu sagen, dass das nichts mit dem Thema zu tun haben soll. Tipp: Wie könnte man wohl Strings case-insensitiv vergleichen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195620</guid><dc:creator><![CDATA[Michael E.]]></dc:creator><pubDate>Mon, 26 Mar 2012 16:18:28 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 18:03:47 GMT]]></title><description><![CDATA[<p>Tja, bin eben zu schnell. Aber auch so:</p>
<p>Michael E. schrieb:</p>
<blockquote>
<p>Wie könnte man wohl Strings case-insensitiv vergleichen?</p>
</blockquote>
<p>Die std::transform Methode ist laut (dem bisher sehr zuverlässigem C++-reference) äquivalent zu:</p>
<pre><code class="language-cpp">template &lt; class InputIterator, class OutputIterator, class UnaryOperator &gt;
  OutputIterator transform ( InputIterator first1, InputIterator last1,
                             OutputIterator result, UnaryOperator op )
{
  while (first1 != last1)
    *result++ = op(*first1++);  // or: *result++=binary_op(*first1++,*first2++);
  return result;
}
</code></pre>
<p>Was resultiert zu mit Input &amp; OutputIterator = std::basic_string&lt;char&gt;::iterator, UnaryOperator = tolower/toupper:</p>
<pre><code class="language-cpp">OutputIterator transform ( std::string::iterator first1, std::string::iterator last1,std::string::iterator result, int(*)(int) op )
{
  while (first1 != last1)
    *result++ = tolower(*first1++);  
  return result;
}
</code></pre>
<p>WAs im Endeffekt wieder nur das macht, was die anderen &quot;Versuche&quot; auch fabrizieren. Ohne den globalen locale vorher zu verändern wird sich hier auch nichts verändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195667</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195667</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 18:03:47 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 18:32:43 GMT]]></title><description><![CDATA[<p>EDIT: <a href="http://ideone.com/k0k5K" rel="nofollow">Ha</a>! Wirft eine Exception. Ha SepJ! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195668</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195668</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 26 Mar 2012 18:32:43 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 19:42:25 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void firstToupperOtherTolower(std::string&amp; str)
{
      if(str.length())
            str.at(0) = std::toupper(str.at(0));

      for(std::string::size_type a(1);a &lt; str.length();++a)
            std::transform&lt;std::string::iterator, std::string::iterator, int(*)(int)&gt;(str.begin(), str.end(), str.begin(), std::tolower);
}
</code></pre>
<p>1. &quot;Capitalize&quot; wäre ein passenderer Name.<br />
2. Wieso checkst du zuerst die Stringlänge und verwendest dann at, das nochmal checkt?<br />
3. Wieso gibst du bei transform explizit der Template-Parameterliste an?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195692</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195692</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Mon, 26 Mar 2012 19:42:25 GMT</pubDate></item><item><title><![CDATA[Reply to std::locale wirt exception on Mon, 26 Mar 2012 19:48:40 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Wobei ich noch nie den Grund verstanden habe, wieso man etwas anderes nehmen sollte als &quot;&quot; (oder &quot;C&quot;), denn ich will nicht, dass ein Programm plötzlich eine ungewöhnte Locale benutzt, bloß weil es von einem Deutschen programmiert wurde. Da ist doch der ganze Sinn von Loacales futsch, wenn das Programm nicht die Systemlocale (und damit <strong>meine</strong> Sprache) benutzt (oder wenn es sein muss die Standardlocale), sondern die Sprache des Programmierers.</p>
</blockquote>
<p>Na es könnte sein dass man dem <s>Programmierer</s> User eine Option anbieten möchte die Sprache/Locale selbst auszuwählen, unabhängig von der im OS eingestellten Sprache.</p>
<p>Denk an Embedded Systems. Kann schnell passieren dass man während das Programm läuft die Sprache/Locale umschalten möchte.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2195693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2195693</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 26 Mar 2012 19:48:40 GMT</pubDate></item></channel></rss>