<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:a="urn:schemas-microsoft-com:office:access" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" xmlns:b="urn:schemas-microsoft-com:office:publisher" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:c="urn:schemas-microsoft-com:office:component:spreadsheet" xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:q="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rtc="http://microsoft.com/officenet/conferencing" xmlns:D="DAV:" xmlns:Repl="http://schemas.microsoft.com/repl/" xmlns:mt="http://schemas.microsoft.com/sharepoint/soap/meetings/" xmlns:x2="http://schemas.microsoft.com/office/excel/2003/xml" xmlns:ppda="http://www.passport.com/NameSpace.xsd" xmlns:ois="http://schemas.microsoft.com/sharepoint/soap/ois/" xmlns:dir="http://schemas.microsoft.com/sharepoint/soap/directory/" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:udc="http://schemas.microsoft.com/data/udc" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sub="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/" xmlns:ec="http://www.w3.org/2001/04/xmlenc#" xmlns:sp="http://schemas.microsoft.com/sharepoint/" xmlns:sps="http://schemas.microsoft.com/sharepoint/soap/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:udcs="http://schemas.microsoft.com/data/udc/soap" xmlns:udcxf="http://schemas.microsoft.com/data/udc/xmlfile" xmlns:udcp2p="http://schemas.microsoft.com/data/udc/parttopart" xmlns:wf="http://schemas.microsoft.com/sharepoint/soap/workflow/" xmlns:dsss="http://schemas.microsoft.com/office/2006/digsig-setup" xmlns:dssi="http://schemas.microsoft.com/office/2006/digsig" xmlns:mdssi="http://schemas.openxmlformats.org/package/2006/digital-signature" xmlns:mver="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:mrels="http://schemas.openxmlformats.org/package/2006/relationships" xmlns:spwp="http://microsoft.com/sharepoint/webpartpages" xmlns:ex12t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:ex12m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:pptsl="http://schemas.microsoft.com/sharepoint/soap/SlideLibrary/" xmlns:spsl="http://microsoft.com/webservices/SharePointPortalServer/PublishedLinksService" xmlns:Z="urn:schemas-microsoft-com:" xmlns:st="&#1;" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='color:#1F497D'>I&#8217;ve updated the bug with an additional patch (had a &nbsp;bug for some configuration cases).<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='color:#1F497D'>What is the procedure to get this patch considered and applied?&nbsp; Do I need to contact the Visual Studio Generator maintainer directly?<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron C. Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'> </span><span style='color:#1F497D'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Meadows, Aaron C. <br><b>Sent:</b> Tuesday, June 21, 2011 9:49 AM<br><b>To:</b> Meadows, Aaron C.; cmake@cmake.org<br><b>Subject:</b> RE: [CMake] Bug #12189<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><span style='color:#1F497D'>I updated the bug with this patch and some of the details from below.<o:p></o:p></span></p><p class=MsoNormal><span style='color:#1F497D'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron C. Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'> </span><span style='color:#1F497D'><o:p></o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> cmake-bounces@cmake.org [mailto:cmake-bounces@cmake.org] <b>On Behalf Of </b>Meadows, Aaron C.<br><b>Sent:</b> Monday, June 20, 2011 5:17 PM<br><b>To:</b> cmake@cmake.org<br><b>Subject:</b> [CMake] Bug #12189<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>(link: <a href="http://public.kitware.com/Bug/view.php?id=12189">http://public.kitware.com/Bug/view.php?id=12189</a>)<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I just came across the above bug opened last month,&nbsp; Summaraized as: &#8220;<span class=apple-style-span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'>It is not possible to generate a Visual Studio project with ASCII/SBCS character set&#8221;.&nbsp; (Full Bug Text Following Message)<o:p></o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'><o:p>&nbsp;</o:p></span></span></p><p class=MsoNormal><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'>I find myself in the situation where I need this to be set to &#8220;not set&#8221;, so as to have ASCII/SBCS as the character set for all my projects.&nbsp; I dug back through the last few years of the maillist and didn&#8217;t see anything about this issue.&nbsp; </span></span>&nbsp;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Anyone have experience with this issue?&nbsp; And better yet, know of a solution?<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I checked the source file he indicated (it&#8217;s on line 702 of the 2.8.4 source):<o:p></o:p></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:Consolas;color:#00B050'>&nbsp; // If unicode is enabled change the character set to unicode, if not<o:p></o:p></span></b></p><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:Consolas;color:#00B050'>&nbsp; // then default to MBCS.<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp; if(targetOptions.UsingUnicode())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; fout &lt;&lt; <b><span style='color:#5F497A'>&quot;\t\t\tCharacterSet=\&quot;1\&quot;&gt;\n&quot;</span></b>;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp; else<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; fout &lt;&lt; <b><span style='color:#5F497A'>&quot;\t\t\tCharacterSet=\&quot;2\&quot;&gt;\n&quot;</span></b>;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Additionally, VS 2010 has a different mechanism (line 287 of the 2.8.4 source):<o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; if(this-&gt;Target-&gt;GetType() &lt;= cmTarget::MODULE_LIBRARY &amp;&amp;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;ClOptions[*i]-&gt;UsingUnicode())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;WriteString(<b><span style='color:#5F497A'>&quot;&lt;CharacterSet&gt;Unicode&lt;/CharacterSet&gt;\n&quot;</span></b>, 2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp; else<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this-&gt;WriteString(<b><span style='color:#5F497A'>&quot;&lt;CharacterSet&gt;MultiByte&lt;/CharacterSet&gt;\n&quot;</span></b>, 2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>In the case of VS 2010, the proper ASCII setting is:<o:p></o:p></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;CharacterSet&gt;<b><span style='color:#5F497A'>NotSet</span></b>&lt;/CharacterSet&gt;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal>It would be fairly trivial to change both these cases to generate the &#8220;Not Set&#8221; case.&nbsp; However, how should backward compatibility be maintained, if at all?&nbsp; <o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;ve created and attached a patch which resolves this bug by adding an &#8220;_SBCS&#8221; define which is checked.&nbsp; If it is set and &#8220;_UNICODE&#8221; is not set, it will write the correct files for the &#8220;Not Set&#8221; ASCII case.&nbsp; This is slightly different than the suggestion in the Bug, but was very easy to write and provides identical behavior if &#8220;_SBCS&#8221; is not set.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>----------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal>Full Bug Text:<o:p></o:p></p><p class=MsoNormal>----------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal style='margin-left:.5in'><span class=apple-style-span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'>In Visual Studio 9.0 (and prior, 10.0 i don't know) it is possible specify three different character sets for your project within the project properties:</span></span><span style='font-size:10.0pt;font-family:"Verdana","sans-serif";color:black'><br><br><span class=apple-style-span>Not Set = ASCII/SBCS (Single Byte Character Set)</span><br><span class=apple-style-span>Unicode</span><br><span class=apple-style-span>Multi-Byte</span><br><br><span class=apple-style-span>Depending on the option different preprocessor defines are set (<a href="http://msdn.microsoft.com/en-us/library/c426s321(v=vs.80).aspx">http://msdn.microsoft.com/en-us/library/c426s321(v=vs.80).aspx</a></span><span class=apple-converted-space>&nbsp;</span><span class=apple-style-span>[<a href="http://msdn.microsoft.com/en-us/library/c426s321(v=vs.80).aspx" target="_blank">^</a>]):</span><br><br><span class=apple-style-span>SBCS: neither _UNICODE nor _MBCS defined</span><br><span class=apple-style-span>Unicode: _UNICODE defined</span><br><span class=apple-style-span>Multi_Byte: _MBCS defined</span><br><br><span class=apple-style-span>The character set settings is stored within the vs proj files as an xml attribute:</span><br><br><span class=apple-style-span>SBCS: CharacterSet=&quot;0&quot;</span><br><span class=apple-style-span>Unicode: CharacterSet=&quot;1&quot;</span><br><span class=apple-style-span>Multi-Byte: CharacterSet=&quot;2&quot;</span><br><br><span class=apple-style-span>However, the cmake visual studio generators do not support generating of projects with CharacterSet=&quot;0&quot; (see cmLocalVisualStudio7Generator.cxx line 730). At the moment the generators select unicode if a _UNICODE macro has been set by add_definitions, otherwise multi-byte is selected.</span><br><br><span class=apple-style-span>To solve the problem and to keep backwards compatability, i suggest to define the _MBCS macro by default for the visual studio generators and to set CharacterSet=&quot;2&quot; only if this macro is still available and otherwise CharacterSet=&quot;0&quot;. In that case the user can remove the _MBCS macro by remove_definitions and select this way the SBCS. If the user adds _UNICODE by add_definitions CharacterSet=&quot;1&quot; should be selected and the conflicting _MBCS macro must be deleted by the code generator.</span></span><o:p></o:p></p><p class=MsoNormal>----------------------------------------------------------------------------------------------------------------------------------<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><div style='border:none;border-top:dotted silver 1.0pt;padding:4.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Aaron Meadows</span></b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'><br>Software Engineer<o:p></o:p></span></p><p class=MsoNormal style='mso-margin-top-alt:9.0pt;margin-right:0in;margin-bottom:9.0pt;margin-left:0in'><b><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#F57F20'>Thomson Reuters<o:p></o:p></span></b></p></div><p class=MsoNormal><span style='font-size:9.0pt;font-family:"Arial","sans-serif";color:#666666'>Phone: 314.468.3530<br>Mobile: 636.541.6139<br>aaron.meadows@thomsonreuters.com<br>thomsonreuters.com</span><o:p></o:p></p></div></body></html>