When compiling the editor and running, shaders fail to compile due to encoding

Translated Question:

When I build the editor from source and try to run, there’s a compile error in the shader, and the editor crashes on load.

I looked into it, and when writing the shader USF file to the preprocessor (MCPP), some of the shader files have an error that says “Unknown encoding: jp”, and the Engine side treats this as an error.

To fix this, inside of \Engine\Source\Developer\ShaderPreprocessor\Private\ShaderPreprocessor.cpp, if I change the contents of the MCPP warning filter function static bool FilterMcppError(const FString& ErrorMsg) to be:

static bool FilterMcppError(const FString& ErrorMsg)
{
    const TCHAR* SubstringsToFilter[] =
    {
       TEXT("Unknown encoding: jp"), // この行を追加
       TEXT("with no newline, supplemented newline"),
       TEXT("Converted [CR+LF] to [LF]")
    };
}

The shader compile stops failing.

This is the first time I built the editor, so there might have been some kind of incorrect setup…

Is anyone else getting this kind of error?

Original Question

Looks like the issue was resolved in the original thread.

Could you provide this response in English? I have the same problem with Polish locale.

The user said that he had an environment variable “LANG=jp” set that was causing the mcpp_run to treat the usf files as if they were encoded in shift jis encoding (a variant of Japanese encoding). So he was able to fix the problem by removing that environment variable, or adding an option to McppOptions to set the language.

Hope that helps!