<?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[wstring in char konvertieren]]></title><description><![CDATA[<p>Hallo,</p>
<p>hab da so ein kleines Problem, ich möchte einen wstring in eine *.csv Datei schreiben, aber bei Öffnen der Datei werden die Trennzeichen (;) nicht richtig erkannt und das Excel teilt die Spalten beliebig auf. Schreibe ich einen normalen string oder char Array dann funkt es. Meine Frage dazu: Wie kann ich einen wstring in ein char Array konvertieren, bzw. so formatieren, dass der Text richtig auf ein char Array geschrieben wird. Da hatte ich immer das Problem, dass nur der erste Buchstabe meines wstrings rausgeschrieben wird....</p>
<p>Bsp:<br />
[cpp]<br />
wsprintf(text, &quot;%02d/%02d/%04d %02d:%02d:%02d;%02d/%02d/%04d %02d:%02d:%02d;%d;%s\r\n&quot;, stopreason.stStopBegin.wDay, stopreason.stStopBegin.wMonth, stopreason.stStopBegin.wYear, stopreason.stStopBegin.wHour, stopreason.stStopBegin.wMinute, stopreason.stStopBegin.wSecond, stopreason.stStopEnd.wDay, stopreason.stStopEnd.wMonth, stopreason.stStopEnd.wYear, stopreason.stStopEnd.wHour, stopreason.stStopEnd.wMinute, stopreason.stStopEnd.wSecond, stopreason.number, stopText);</p>
<p>...stopText ist mein wstring, ich habe auch schon %ls anstatt %ls probiert, dann wird zwar der ganze wstring richtig rausgeschrieben, bleibt aber noch das Problem mit Excel....</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/221887/wstring-in-char-konvertieren</link><generator>RSS for Node</generator><lastBuildDate>Mon, 05 Oct 2026 17:49:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/221887.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 04 Sep 2008 15:51:14 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to wstring in char konvertieren on Thu, 04 Sep 2008 15:51:14 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>hab da so ein kleines Problem, ich möchte einen wstring in eine *.csv Datei schreiben, aber bei Öffnen der Datei werden die Trennzeichen (;) nicht richtig erkannt und das Excel teilt die Spalten beliebig auf. Schreibe ich einen normalen string oder char Array dann funkt es. Meine Frage dazu: Wie kann ich einen wstring in ein char Array konvertieren, bzw. so formatieren, dass der Text richtig auf ein char Array geschrieben wird. Da hatte ich immer das Problem, dass nur der erste Buchstabe meines wstrings rausgeschrieben wird....</p>
<p>Bsp:<br />
[cpp]<br />
wsprintf(text, &quot;%02d/%02d/%04d %02d:%02d:%02d;%02d/%02d/%04d %02d:%02d:%02d;%d;%s\r\n&quot;, stopreason.stStopBegin.wDay, stopreason.stStopBegin.wMonth, stopreason.stStopBegin.wYear, stopreason.stStopBegin.wHour, stopreason.stStopBegin.wMinute, stopreason.stStopBegin.wSecond, stopreason.stStopEnd.wDay, stopreason.stStopEnd.wMonth, stopreason.stStopEnd.wYear, stopreason.stStopEnd.wHour, stopreason.stStopEnd.wMinute, stopreason.stStopEnd.wSecond, stopreason.number, stopText);</p>
<p>...stopText ist mein wstring, ich habe auch schon %ls anstatt %ls probiert, dann wird zwar der ganze wstring richtig rausgeschrieben, bleibt aber noch das Problem mit Excel....</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576618</guid><dc:creator><![CDATA[tirus]]></dc:creator><pubDate>Thu, 04 Sep 2008 15:51:14 GMT</pubDate></item><item><title><![CDATA[Reply to wstring in char konvertieren on Thu, 04 Sep 2008 16:50:52 GMT]]></title><description><![CDATA[<p>WideCharToMultiByte</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576641</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576641</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Thu, 04 Sep 2008 16:50:52 GMT</pubDate></item><item><title><![CDATA[Reply to wstring in char konvertieren on Thu, 04 Sep 2008 17:31:17 GMT]]></title><description><![CDATA[<p>Belli schrieb:</p>
<blockquote>
<p>WideCharToMultiByte</p>
</blockquote>
<p>Wir sind hier im C++ Forum, nicht im WinAPI Forum.</p>
<p>Lösung:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-168607.html" rel="nofollow">std::string &lt;-&gt; std::wstring</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1576662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1576662</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 04 Sep 2008 17:31:17 GMT</pubDate></item></channel></rss>