<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>Debenu Quick PDF Library - PDF SDK Community Forum : characters using MBCS</title>
  <link>http://www.quickpdf.org/forum/</link>
  <description><![CDATA[This is an XML content feed of; Debenu Quick PDF Library - PDF SDK Community Forum : I need help - I can help : characters using MBCS]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Fri, 03 Apr 2026 22:38:41 +0000</pubDate>
  <lastBuildDate>Thu, 24 Jun 2021 10:30:06 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 11.01</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.quickpdf.org/forum/RSS_post_feed.asp?TID=3928</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Debenu Quick PDF Library - PDF SDK Community Forum]]></title>
   <url>http://www.quickpdf.org/forum/forum_images/QPDF_Forum_Title.png</url>
   <link>http://www.quickpdf.org/forum/</link>
  </image>
  <item>
   <title><![CDATA[characters using MBCS : I can&amp;#039;t avoid &amp;#034;telling...]]></title>
   <link>http://www.quickpdf.org/forum/characters-using-mbcs_topic3928_post15784.html#15784</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=1388">tfrost</a><br /><strong>Subject:</strong> 3928<br /><strong>Posted:</strong> 24 Jun 21 at 10:30AM<br /><br /><div>I can't avoid "telling you not to use Unicode", because you are already using Unicode in your MBCS.</div><div><br></div><div>You may think that "ist für alle" is in Windows (USA) default encoding. If it was in default encoding, it would contain the bytes:</div><div><br></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp;69 73 74 20 66 FC 72 20 61 6C 6C 65&nbsp;</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; i&nbsp; s&nbsp; t&nbsp; &nbsp; f&nbsp; &nbsp;ü&nbsp; r&nbsp; &nbsp; &nbsp;a&nbsp; l&nbsp; l&nbsp; e</font></div><div><span style="white-space:pre">	</span></div><div>But what you are passing to your CString2Wide function is in a Multibyte Character Set (MBCS) encoding of Unicode, UTF8:</div><div><br></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp;69 73 74 20 66 C3 BC 72 20 61 6C 6C 65&nbsp;</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; i&nbsp; s&nbsp; t&nbsp; &nbsp; f&nbsp; &nbsp; ü&nbsp; &nbsp; r&nbsp; &nbsp; &nbsp;a&nbsp; l&nbsp; l&nbsp; e</font></div><div>&nbsp; &nbsp;</div><div>When you simply 'cast' this to a Wide String, the program assumes that it is default encoding, so interprets it as such:</div><div><br></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp;69 73 74 20 66 C3 BC 72 20 61 6C 6C 65&nbsp;</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; i&nbsp; s&nbsp; t&nbsp; &nbsp; f&nbsp; &nbsp;Ã&nbsp; ¼&nbsp; r&nbsp; &nbsp; &nbsp;a&nbsp; l&nbsp; l&nbsp; e</font></div><div><span style="white-space:pre">	</span></div><div>And this becomes, as a Wide String:<span style="white-space:pre">	</span></div><div><br></div><div>&nbsp;<font face="Courier New, Courier, mono"> &nbsp;0069 0073 0074 0020 0066 00C3 00BC 0072 0020 0061 006C 006C 0065&nbsp;</font></div><div><font face="Courier New, Courier, mono">&nbsp; &nbsp; &nbsp;i&nbsp; &nbsp; s&nbsp; &nbsp; t&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;f&nbsp; &nbsp; Ã&nbsp; &nbsp; ¼&nbsp; &nbsp; r&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;a&nbsp; &nbsp; l&nbsp; &nbsp; l&nbsp; &nbsp; e</font></div><div><span style="white-space:pre">	</span>&nbsp;&nbsp;</div><div>To fix this in your program and continue to use MBCS elsewhere, I suggest converting your MBCS (UTF8) string to WideChars (UTF16) using MultiByteToWideChar, using CP_UTF8 as the first parameter.&nbsp; The method you have used works only for ASCII, as you have found.&nbsp; You will find plenty of examples for MultibyteToWideChar; since it takes an input and an output buffer as parameters, it is easiest to use inline, not as a function.</div>]]>
   </description>
   <pubDate>Thu, 24 Jun 2021 10:30:06 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/characters-using-mbcs_topic3928_post15784.html#15784</guid>
  </item> 
  <item>
   <title><![CDATA[characters using MBCS : I&amp;#039;m using MBCS in MFC C++....]]></title>
   <link>http://www.quickpdf.org/forum/characters-using-mbcs_topic3928_post15783.html#15783</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.quickpdf.org/forum/member_profile.asp?PF=3279">Tullhead</a><br /><strong>Subject:</strong> 3928<br /><strong>Posted:</strong> 24 Jun 21 at 12:56AM<br /><br />I'm using MBCS in MFC C++.&nbsp; &nbsp; When I am ready to pass the string to Debenu, I use<div><br></div><div><div>LPCWSTR CString2Wide(CString s)</div><div>{</div><div><span style="white-space:pre">	</span>_bstr_t bs = s;</div><div><span style="white-space:pre">	</span>return (wchar_t*)bs;</div><div>}</div></div><div><br></div><div>So, a call looks something like:</div><div><br></div><div>pPDF-&gt;DrawText(160, 100, CString2Wide(MyTitle));&nbsp;</div><div><br></div><div>All this works fine for plain English strings.&nbsp; &nbsp;Now I want to support German, French, and Spanish.</div><div>So, just umlauts and accents.&nbsp; This can all be done in MBCS (in theory) with no need to go to UNICODE.</div><div>I want to avoid UNICODE for now.</div><div><br></div><div>Now when I pass it a German string like:&nbsp;&nbsp;ist für alle</div><div><br></div><div>It shows up in the PDF like this:&nbsp;ist fÃ¼r alle</div><div><br></div><div>How can I fix this?&nbsp; Thanks if you can help.&nbsp; Don't tell me to use UNICODE.</div><div><br></div>]]>
   </description>
   <pubDate>Thu, 24 Jun 2021 00:56:22 +0000</pubDate>
   <guid isPermaLink="true">http://www.quickpdf.org/forum/characters-using-mbcs_topic3928_post15783.html#15783</guid>
  </item> 
 </channel>
</rss>