# Monogame pipeline tool: “Build failed: 1 is not a supported code page.”

I've previously done some coding with Monogame 3.6 in VS 2015 on Windows 10 without any problems, including using the pipeline tool. Last week I was forced to reinstall my whole system and now have VS 2017 + Monogame 3.6. Suddenly the pipeline tool does not do anything anymore, instead of a report on the build success of the various items i only get the following output (which only shows up when I disable the "filter output" setting):

Build failed: 1 is not a supported code page.
Parameter name: codepage

I'm rather lost with this one and google did not return anything useful. Since I reinstalled the whole system I guess it could also be something missing which is not directly installed by VS or Monogame and got on my old system some other way.

Any ideas what is going wrong here?

• I've done a quick search, and according to this source: link, it -might- be depending on the Regional Settings - Language. If you change that to the correct Regional settings. But I'm not certain. – Steven Nov 21 '17 at 7:28
• Thanks for that tip! Setting the language to English - US solved it! I'm actually in Austria, but had set Windows to Englisch - GB during install, maybe something got messed up that way. – Flo B Nov 21 '17 at 10:54
• @Steven you should turn that comment into an answer so that FloB can accept the answer. – Tyyppi_77 Nov 21 '17 at 11:14
• Done, thank you. And glad to hear that it worked out. – Steven Nov 21 '17 at 11:34

According to this source. It might be depending on the Regional Settings - Language.
So it's possible that during the reïnstall, your regional settings have changed.

Setting it back to the regional setting where you have developed your game with will fix your problem.

A quick look through Pipeline.exe reveals that the build action executes code equivalent to the following:

System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.OEMCodePage);


Which as far as i can tell, relates to how messages are printed in the output log. (They originate from another native process, presumably MGCB.exe)

Try running the above line of code any C# environment and you should be able to reproduce the error.

You can try and change the locale as according to the other answer, but that solution has a lot of side effects, as it affects all other processes as well, and in my case it did not work anyway.

An alternative solution is to modify the assembly: In pipeline.exe - Module: Monogame.Tools.Pipeline - Class: PipelineController - Method: DoBuild - Around Line: 0x0089

Replace:

call class [mscorlib]System.Globalization.CultureInfo [mscorlib]System.Globalization.CultureInfo::get_CurrentCulture()
callvirt instance class [mscorlib]System.Globalization.TextInfo [mscorlib]System.Globalization.CultureInfo::get_TextInfo()
callvirt instance int32 [mscorlib]System.Globalization.TextInfo::get_OEMCodePage()


with:

ldc.i4.0


Turning:

System.Text.Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.OEMCodePage);


Into:

System.Text.Encoding.GetEncoding(0);


Which is the system default encoding instead of the OEM encoding.