<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="" 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: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-compose;
        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;}
.MsoChpDefault
        {mso-style-type:export-only;}
@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>(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> </o:p></p><p class=MsoNormal>I just came across the above bug opened last month, Summaraized as: “<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”. (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> </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 “not set”, so as to have ASCII/SBCS as the character set for all my projects. I dug back through the last few years of the maillist and didn’t see anything about this issue. </span></span> <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Anyone have experience with this issue? And better yet, know of a solution?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I checked the source file he indicated (it’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'> // 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'> // then default to MBCS.<o:p></o:p></span></b></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> if(targetOptions.UsingUnicode())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> fout << <b><span style='color:#5F497A'>"\t\t\tCharacterSet=\"1\">\n"</span></b>;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> else<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> fout << <b><span style='color:#5F497A'>"\t\t\tCharacterSet=\"2\">\n"</span></b>;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> }<o:p></o:p></span></p><p class=MsoNormal><o:p> </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'> if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> this->ClOptions[*i]->UsingUnicode())<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> this->WriteString(<b><span style='color:#5F497A'>"<CharacterSet>Unicode</CharacterSet>\n"</span></b>, 2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> }<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> else<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> {<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> this->WriteString(<b><span style='color:#5F497A'>"<CharacterSet>MultiByte</CharacterSet>\n"</span></b>, 2);<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'> }<o:p></o:p></span></p><p class=MsoNormal><o:p> </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'> <CharacterSet><b><span style='color:#5F497A'>NotSet</span></b></CharacterSet><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:9.0pt;font-family:Consolas'><o:p> </o:p></span></p><p class=MsoNormal>It would be fairly trivial to change both these cases to generate the “Not Set” case. However, how should backward compatibility be maintained, if at all? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’ve created and attached a patch which resolves this bug by adding an “_SBCS” define which is checked. If it is set and “_UNICODE” is not set, it will write the correct files for the “Not Set” ASCII case. This is slightly different than the suggestion in the Bug, but was very easy to write and provides identical behavior if “_SBCS” is not set.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </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> </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="0"</span><br><span class=apple-style-span>Unicode: CharacterSet="1"</span><br><span class=apple-style-span>Multi-Byte: CharacterSet="2"</span><br><br><span class=apple-style-span>However, the cmake visual studio generators do not support generating of projects with CharacterSet="0" (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="2" only if this macro is still available and otherwise CharacterSet="0". 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="1" 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> </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>