<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx</link><description>I was looking at Elyasse's Weblog and was reminded of one of the coolest feature entries in Whidbey. I think I have been waiting roughly 112 versions of the Microsoft compilers for this. Well, probably not that many but it does feel like that.... New</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#349271</link><pubDate>Sun, 09 Jan 2005 00:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:349271</guid><dc:creator>Anon</dc:creator><description>&amp;quot;C4819 occurs when a non-ANSI compliant compiler ignores clause 2.1 (Phases of Translation) in the C++ standard and does not map physical source characters to the basic source character set&amp;quot;</description></item><item><title>How does it detect invalid characters?</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#349290</link><pubDate>Sun, 09 Jan 2005 01:35:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:349290</guid><dc:creator>Michael Kaplan</dc:creator><description>Answer to the question this post implied....</description></item><item><title>re: The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#349450</link><pubDate>Sun, 09 Jan 2005 16:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:349450</guid><dc:creator>Anon</dc:creator><description>Ah, it generates this when it can't perform the mapping because it has encountered a nonsense byte? That's fine, but I still think &amp;quot;save the file as unicode&amp;quot; is duff advice considering all the legacy source control systems out there...&lt;br&gt;&lt;br&gt;I'm now curious. What did the compiler do prior to Whidbey? Assume a particular codepage?</description></item><item><title>re: The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#349476</link><pubDate>Sun, 09 Jan 2005 17:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:349476</guid><dc:creator>Michael Kaplan</dc:creator><description>Well, the advice is for *new* code, not legacy.&lt;br&gt;&lt;br&gt;Legacy systems would always save the file as ANSI and so the characters in question would be converted to question marks (same as in notepad when you try to save as ANSI).</description></item><item><title>re: The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#8464049</link><pubDate>Wed, 07 May 2008 01:05:30 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8464049</guid><dc:creator>Vladislav Vaintroub</dc:creator><description>&lt;p&gt;Too much i18n does not seem good for the compiler.&lt;/p&gt;
&lt;p&gt;Michael, by all respect I cannot share your view on this &amp;quot;incredibly cool&amp;quot; feature. I think it is incredibly uncool.&lt;/p&gt;
&lt;p&gt;The bad thing about this warning &amp;nbsp;can result to an error like here&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=341454"&gt;http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=341454&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;is that : C strings, &amp;nbsp;the null terminated arrays of bytes,&lt;/p&gt;
&lt;p&gt;do not have any encoding information per se, i.e are supposed to be treated as opaque arrays of bytes. Now, I have a perfectly valid&lt;/p&gt;
&lt;p&gt;C file, containing ASCII-only, except for UTF8 bytes instrings (UTF8 for a good reason, I intend to edit this file in UTF-8 editor). And such a file will break with incomprehensible message on Whidbey on Japanese Windows now &lt;/p&gt;
&lt;p&gt;The connect bug is now resolved with Won't Fix, so I can not even hope that this will be fixed with the next version of the compiler.&lt;/p&gt;
&lt;p&gt;Alternatives for me?&lt;/p&gt;
&lt;p&gt;1)Documentation and support says &amp;nbsp;- add a BOM to the file. No way, then it will break on older compiler and on non-Microsoft compilers.&lt;/p&gt;
&lt;p&gt;2)#pragma setlocale?&lt;/p&gt;
&lt;p&gt;Does not work&lt;/p&gt;
&lt;p&gt;3) convert strings &amp;nbsp;to &amp;nbsp;their hex-byte-array array form&lt;/p&gt;
&lt;p&gt;something like&lt;/p&gt;
&lt;p&gt;char foo={0xba,0xad,0xf0,0x0d,0x00}?&lt;/p&gt;
&lt;p&gt;Will work, will look ugly and I'll have to forget about editing this file in a my wonderful UTF8 -capable editor , VS2005 IDE.&lt;/p&gt;
&lt;p&gt;Or forget about getting this file compiled on Japanese Windows. It is not important *for me* anyway. &amp;nbsp;This compiler works quite well on latin1 territories:)&lt;/p&gt;</description></item><item><title>re: The new compiler error C4819</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#8464134</link><pubDate>Wed, 07 May 2008 01:37:16 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8464134</guid><dc:creator>Michael S. Kaplan</dc:creator><description>&lt;P&gt;Since the BOM does exist, you could also petition the other compilers to start recognizing it, too. I'm sorry, but I agree with Jonathan Caves on this issue -- use the BOM and you are golden.&lt;/P&gt;</description></item><item><title>Everyone seems averse to the BOM these days; Should we blame TSA? :-)</title><link>http://blogs.msdn.com/michkap/archive/2005/01/05/347394.aspx#8519162</link><pubDate>Mon, 19 May 2008 18:42:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8519162</guid><dc:creator>Sorting it all Out</dc:creator><description>&lt;p&gt;Sometimes things work by accident. You know -- no one ever planned for it to work, no one tested it to&lt;/p&gt;
</description></item></channel></rss>