F# Interactive Encoding #779

FallenPhoenix opened this Issue Sep 28, 2016 · 1 comment


None yet
1 participant

FallenPhoenix commented Sep 28, 2016

Hello again.
I found one more encoding issue, and now its FSI.exe process.
It should be current system language OEM encoding, because there language pack available:

FSharpInteractive.cs, lines starting from 76:

            if (foundCompiler) {
                var encoding = Encoding.ASCII;
                var lang = System.Globalization.CultureInfo.CurrentUICulture;
                var bin_path = Path.GetDirectoryName(fsiProcess.StartInfo.FileName);
                if (File.Exists(string.Format(@"{0}\{1}\Fsi.resources.dll", bin_path, lang.Name)));
                    encoding = Encoding.GetEncoding(lang.TextInfo.OEMCodePage);
                //fsiProcess.StartInfo.Arguments <- "--fsi-server sharpdevelopfsi";
                fsiProcess.StartInfo.UseShellExecute = false;
                fsiProcess.StartInfo.CreateNoWindow = true;
                fsiProcess.StartInfo.RedirectStandardError = true;
                fsiProcess.StartInfo.RedirectStandardInput = true;
                fsiProcess.StartInfo.RedirectStandardOutput = true;
                fsiProcess.StartInfo.StandardErrorEncoding = encoding;
                fsiProcess.StartInfo.StandardOutputEncoding = encoding;
                fsiProcess.EnableRaisingEvents = true;

Maybe it's not absolutely correct fix, but for me it works (Russian locale), and probably for other supported languages too.

Full path for Russian resource dll for me is:
C:\Program Files (x86)\Microsoft F#\v4.0\ru\Fsi.resources.dll


This comment has been minimized.

Show comment
Hide comment

FallenPhoenix Oct 17, 2016

Maybe also possible to use this OemEncoding instead (screenshot from 3rd version):

Maybe also possible to use this OemEncoding instead (screenshot from 3rd version):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment