After updating to 4.17.1 I get many of this warning like:
The file contains a character starting at offset 0x308 that is illegal in the current source character set (codepage 65001).
And all this warnings mention comment sections, as there often used local language(with non-latin characters).
As I investigated unreal engine’s github source changes and there were changes in UnrealEngine\Engine\Source\Runtime\Core\Public\Windows\WindowsPlatformCompilerSetup.h file related to this warning (4828).
Is it now should be avoided using local languages in unreal projects(in comments)? Or this warning was re-enabled because some other users experienced some another issues?
We have removed follwing block at VCToolChain.cs, and it works.
===================================
// Fix Incredibuild errors with helpers using heterogeneous character sets
if (Compiler >= WindowsCompiler.VisualStudio2015)
{
Arguments.Add("/source-charset:utf-8 /execution-charset:utf-8");
}
You can open your file, which contain this warning, for ex. GameMode.cpp. Then click File->AdvancedSavedOptions and choose Encoding Mode. For us solution variant was “Unicode (UTF-8 with signature) - Codepage 65001”.
Hope this helps.
This option is not available in VS version 2017 anymore.
From the Visual Studio support forum:
"We removed this item from the menu
due to uncommon use. You can still
access the functionality through
File-> Save As → then clicking the
down arrow on the Save button and
clicking “Save With Encoding…”.
You can also add it back to the File menu through Tools->Customize->Commands if you want to."
And in case you wonder if it’s Utf8 with or without signature (aka BOM), just read these lines from Unicode Standard document:
“… Use of a BOM is neither required
nor recommended for UTF-8, but may be
encountered in contexts where UTF-8
data is converted from other encoding
forms that use a BOM or where the BOM
is used as a UTF-8 signature. See the
“Byte Order Mark” subsection in
Section 16.8, Specials, for more
information.”
So Utf8 without signature. The signature tells the file readers that it’s utf8, basically, but they can tell anyway, afaik.