# Warning C4828

**URL:** <https://forums.unrealengine.com/t/warning-c4828/403321>\
**Category:** C++\
**Tags:** UE4-17, warning, unreal-engine, CPP, question\
**Created:** [August 30, 2017, 10:03pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321 "2017-08-30T22:03:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nynjed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nynjed](https://forums.unrealengine.com/u/nynjed)\
**Post date:** [August 30, 2017, 10:03pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/1 "2017-08-30T22:03:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f6c04a8c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f6c04a8c](https://forums.unrealengine.com/u/anonymous_user_f6c04a8c)\
**Post date:** [September 3, 2017, 12:08pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/2 "2017-09-03T12:08:43Z")

</div>

I am seeing this too.  
We cannot really change all our coded local languague, there are so many for various editor-only warnings.

WindowsPlatformCompilerSetup.h actually disables the warning by (#pragma warning(disable : 4828)), but it does not seem to working.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f6c04a8c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f6c04a8c](https://forums.unrealengine.com/u/anonymous_user_f6c04a8c)\
**Post date:** [September 4, 2017, 5:26am UTC](https://forums.unrealengine.com/t/warning-c4828/403321/3 "2017-09-04T05:26:48Z")

</div>

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");
        }

```

===================================

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7ffa82a4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7ffa82a4](https://forums.unrealengine.com/u/anonymous_user_7ffa82a4)\
**Post date:** [September 4, 2017, 6:06am UTC](https://forums.unrealengine.com/t/warning-c4828/403321/4 "2017-09-04T06:06:02Z")

</div>

This is because your code contains characters like “àäâéèö…”.

Remove all of them even in comments.

---

<div class="post-metadata">

**Author:** ![nynjed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nynjed](https://forums.unrealengine.com/u/nynjed)\
**Post date:** [September 4, 2017, 4:19pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/5 "2017-09-04T16:19:26Z")

</div>

Actually I’m prefer to not modify engine. But as temporary solution maybe try somehow(if it later be fixed)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f6c04a8c](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f6c04a8c](https://forums.unrealengine.com/u/anonymous_user_f6c04a8c)\
**Post date:** [September 5, 2017, 12:18am UTC](https://forums.unrealengine.com/t/warning-c4828/403321/6 "2017-09-05T00:18:06Z")

</div>

Right, but we’ve just gone too far, and had no choice other than fixing it whenever possible… =(

---

<div class="post-metadata">

**Author:** ![dendnk](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/dendnk/32/945774_2.png) [@dendnk](https://forums.unrealengine.com/u/dendnk)\
**Post date:** [November 13, 2017, 9:27am UTC](https://forums.unrealengine.com/t/warning-c4828/403321/7 "2017-11-13T09:27:16Z")

</div>

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.

![219977-help1.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/9/0/590c584dacad9efde27412e77254262b2bfbc770.png)

---

<div class="post-metadata">

**Author:** ![nynjed](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@nynjed](https://forums.unrealengine.com/u/nynjed)\
**Post date:** [November 28, 2017, 12:25am UTC](https://forums.unrealengine.com/t/warning-c4828/403321/8 "2017-11-28T00:25:15Z")

</div>

Thanks. It works!

---

<div class="post-metadata">

**Author:** ![darkgaze](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@darkgaze](https://forums.unrealengine.com/u/darkgaze)\
**Post date:** [January 24, 2018, 12:27pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/9 "2018-01-24T12:27:40Z")

</div>

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."

> **[Developer Community](https://developercommunity.visualstudio.com/content/problem/8290/file-advanced-save-options-option-is-missed.html)**
>
> Developer Community

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.

---

<div class="post-metadata">

**Author:** ![Tarquiscani0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tarquiscani0](https://forums.unrealengine.com/u/Tarquiscani0)\
**Post date:** [May 1, 2021, 9:17pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/10 "2021-05-01T21:17:10Z")

</div>

This is the proper solution. A tool that automatically find these illegal characters would be useful

---

<div class="post-metadata">

**Author:** ![Babush61](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Babush61](https://forums.unrealengine.com/u/Babush61)\
**Post date:** [March 31, 2026, 8:22pm UTC](https://forums.unrealengine.com/t/warning-c4828/403321/11 "2026-03-31T20:22:06Z")

</div>

To search for non-ASCII characters, use a regular expression in Visual Studio:

> [^\x00-\x7F]+

or

> [^\t\r\n\x20-\x7E]+

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/4/fb4003551c18a0db139f443f97fb4f591ce9d0fa.png)
