warning C4819: How to find the character that has to be saved in unicode?

at line 176:

BOOST_ASSERT(0); // §27.4.3.2 allows undefined-behaviour here

You see, there is a character before 27 in the above line.


You can use the regex shown above in Visual Studio to locate those characters. Here is the Regex: [^\x00-\x7F]


I met this problem in my project and tried to modify all non-unicode characters. But I had to give up and found a another way, as there were too many files with such problem (even though all of them are in comments).

Then I found a quick way to fix this by setting 'system locale'.

Control Panel -> Clock,Language,and Region -> Region and Language -> 
Administrative -> Language for non-Unicode programs -> Change system locale -> English

I think this could fix your problem if your 'system locale' is not English.

https://stackoverflow.com/a/37871883/3148107


You can use Notepad++ to find all Unicode characters in a file using a regular expression:

  1. Open your file in Notepad++.
  2. Ensure that you select UTF-8 from the Encoding menu.
  3. Open the search box (use CTRL-F or go to the Search menu and select Find...).
  4. Under Search Mode, select the radio button for Regular expression.
  5. Enter [^\x00-\x7F] in the Find what box and hit the Find Next button to see what you get.

After you find the Unicode character(s), you can remove/change them, change the encoding back to ANSI, and save the file.

You don't have to use Notepad++, of course. The RegEx will work in other text editors, e.g., Sublime Text.