More on the C4819 error

by Michael S. Kaplan, published on 2005/12/09 22:01 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/12/09/502290.aspx


The other day, Raoul contacted me with the following question:

I found your blog doing trying to figure out a warning I'm currently getting in VS2005, and am hoping you might be able to help me out. Sorry to bother you...

My company's currently considering switching to VS2005, and in one of our files a C4819 error has popped up twice now for no obvious reason... We had one other file with the error and there were a few bad characters in there, but in the problem file, I can't seem to find anything that's actually broken... In fact, if I put a #pragma warning(disable:4819) around the block that gets the warning, the file compiles fine, but if I delete the block in question, the error is still there... does this make sense at all? I guess we could add the warning to our project ignore list, but that seems like a waste of valid information...

Raoul is talking about one or both of the following posts:

One of the problems that can come up is something invalid that does not have a visible representation, or something that looks close enough to a valid character to escape attempts to find the problem.

In the end, the easiest way I have found to deal with this is to open the file in Notepad and then use "File | Save as..." to save it as an ANSI file. This will convert the bad character(s) to the default character which should be easy to spot (or at least easier).

I think there is an option to do this in Visual Studio, too -- but I have not looked into that yet. And Notepad is something I know. :-)

 

This post brought to you by "แกต" (U+1875, MONGOLIAN LETTER MANCHU RA)


no comments

referenced by

2008/05/19 Everyone seems averse to the BOM these days; Should we blame TSA? :-)

go to newer or older post, or back to index or month or day